add test from PR#9799

master
Thomas Refis 2020-07-27 15:33:59 +02:00
parent 04bceec6cc
commit b938cb32c5
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
(* TEST
* expect
*)
type 'a t =
| A: [`a|`z] t
| B: [`b|`z] t
;;
[%%expect{|
type 'a t = A : [ `a | `z ] t | B : [ `b | `z ] t
|}];;
let fn: type a. a t -> a -> int = fun x y ->
match (x, y) with
| (A, `a)
| (B, `b) -> 0
| (A, `z)
| (B, `z) -> 1
;;
[%%expect{|
Uncaught exception: File "typing/patterns.ml", line 199, characters 21-27: Assertion failed
|}];;