summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-misc-bugs/gadt_declaration_check.ml
blob: 432a502ff270381f100a7c7af030b35511118120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(* TEST
   * expect
*)
type foo = Foo;;
[%%expect{|
type foo = Foo
|}];;

(* this should fail with an error message,
   not an uncaught exception (as it did temporarily
   during the development of typedecl_separability) *)
type bar = Bar : foo;;
[%%expect{|
Line 1, characters 17-20:
1 | type bar = Bar : foo;;
                     ^^^
Error: Constraints are not satisfied in this type.
       Type foo should be an instance of bar
|}];;