Skip to content

Commit

Permalink
testsuite: test "no intersection" error message
Browse files Browse the repository at this point in the history
test the error message for non-intersecting polymorphic variant types.
  • Loading branch information
Octachron committed Feb 26, 2019
1 parent ce95fa4 commit 70a9134
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testsuite/tests/typing-misc/polyvars.ml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,13 @@ Here is an example of a case that is not matched:
(`AnyOtherTag', `AnyOtherTag'')
val f : [> `AnyOtherTag ] * [> `AnyOtherTag | `AnyOtherTag' ] -> int = <fun>
|}]

let x:(([`A] as 'a)* ([`B] as 'a)) = [`A]
[%%expect {|
Line 1, characters 22-32:
1 | let x:(([`A] as 'a)* ([`B] as 'a)) = [`A]
^^^^^^^^^^
Error: This alias is bound to type [ `B ] but is used as an instance of type
[ `A ]
These two variant types have no intersection
|}]

0 comments on commit 70a9134

Please sign in to comment.