summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/typing-misc/polyvars.ml
blob: 00dacf7540fcb42349d9869c4263064d8a3c7e00 (plain)
1
2
3
4
5
6
7
type ab = [ `A | `B ];;
let f (x : [`A]) = match x with #ab -> 1;;
let f x = ignore (match x with #ab -> 1); ignore (x : [`A]);;
let f x = ignore (match x with `A|`B -> 1); ignore (x : [`A]);;

let f (x : [< `A | `B]) = match x with `A | `B | `C -> 0;; (* warn *)
let f (x : [`A | `B]) = match x with `A | `B | `C -> 0;; (* fail *)