diff options
Diffstat (limited to 'testsuite/tests/typing-gadts/test.ml.principal.reference')
| -rw-r--r-- | testsuite/tests/typing-gadts/test.ml.principal.reference | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/testsuite/tests/typing-gadts/test.ml.principal.reference b/testsuite/tests/typing-gadts/test.ml.principal.reference index 5e4458a981..f692325f1d 100644 --- a/testsuite/tests/typing-gadts/test.ml.principal.reference +++ b/testsuite/tests/typing-gadts/test.ml.principal.reference @@ -1,19 +1,19 @@ # module Exp : sig - type 'a t = + type _ t = IntLit : int -> int t | BoolLit : bool -> bool t | Pair : 'a t * 'b t -> ('a * 'b) t | App : ('a -> 'b) t * 'a t -> 'b t | Abs : ('a -> 'b) -> ('a -> 'b) t - val eval : 'a t -> 'a + val eval : 's t -> 's val discern : 'a t -> int end # module List : sig type zero - type 'a t = Nil : zero t | Cons : 'a * 'b t -> ('a * 'b) t + type _ t = Nil : zero t | Cons : 'a * 'b t -> ('a * 'b) t val head : ('a * 'b) t -> 'a val tail : ('a * 'b) t -> 'b t val length : 'a t -> int @@ -35,17 +35,17 @@ module Nonexhaustive : sig type 'a u = C1 : int -> int u | C2 : bool -> bool u type 'a v = C1 : int -> int v - val unexhaustive : 'a u -> 'a + val unexhaustive : 's u -> 's module M : sig type t type u end type 'a t = Foo : M.t -> M.t t | Bar : M.u -> M.u t - val same_type : 'a t * 'a t -> bool + val same_type : 's t * 's t -> bool end # module Exhaustive : sig type t = int type u = bool type 'a v = Foo : t -> t v | Bar : u -> u v - val same_type : 'a v * 'a v -> bool + val same_type : 's v * 's v -> bool end # Characters 119-120: let eval (D x) = x @@ -76,7 +76,7 @@ Error: This expression has type bool but an expression was expected of type s ^ Error: This pattern matches values of type b but a pattern was expected which matches values of type a -# type 'a t = Int : int t +# type _ t = Int : int t # val ky : 'a -> 'a -> 'a = <fun> # val test : 'a t -> 'a = <fun> # val test : 'a t -> int = <fun> @@ -138,11 +138,11 @@ Error: This expression has type a = int This instance of int is ambiguous: it would escape the scope of its equation # val f : 'a t -> int -> int = <fun> -# type 'a h = Has_m : < m : int > h | Has_b : < b : bool > h +# type _ h = Has_m : < m : int > h | Has_b : < b : bool > h val f : 'a h -> 'a = <fun> -# type 'a j = Has_A : [ `A of int ] j | Has_B : [ `B of bool ] j +# type _ j = Has_A : [ `A of int ] j | Has_B : [ `B of bool ] j val f : 'a j -> 'a = <fun> -# type ('a, 'b) eq = Eq : ('a, 'a) eq +# type (_, _) eq = Eq : ('a, 'a) eq # Characters 5-91: ....f : type a b. (a,b) eq -> (<m : a; ..> as 'a) -> (<m : b; ..> as 'a) = fun Eq o -> o @@ -205,8 +205,8 @@ Error: This expression has type [> `A of a ] ....f : type a b. (a,b) eq -> [< `A of a | `B] -> [< `A of b | `B] = fun Eq o -> o.............. Error: This definition has type - ('c, 'd) eq -> ([< `A of 'd & 'c | `B ] as 'e) -> 'e - which is less general than 'a 'b. ('a, 'b) eq -> 'e -> 'e + ('a, 'b) eq -> ([< `A of 'b & 'a | `B ] as 'c) -> 'c + which is less general than 'a0 'b0. ('a0, 'b0) eq -> 'c -> 'c # val f : ('a, 'b) eq -> [ `A of 'a | `B ] -> [ `A of 'b | `B ] = <fun> # val f : ('a, int) eq -> [ `A of 'a ] -> bool = <fun> # Characters 166-167: @@ -226,7 +226,7 @@ Error: This expression has type [> `A of a | `B ] This instance of a is ambiguous: it would escape the scope of its equation # type 'a t = A of int | B of bool | C of float | D of 'a -type 'a ty = +type _ ty = TE : 'a ty -> 'a array ty | TA : int ty | TB : bool ty @@ -276,11 +276,11 @@ Error: This expression has type (a, a) eq but an expression was expected of type (a, b) eq # val f : ('a M.t * 'a, 'b M.t * 'b) eq -> ('a, 'b) eq = <fun> # val f : ('a * 'a M.t, 'b * 'b M.t) eq -> ('a, 'b) eq = <fun> -# type 'a t = V1 : [ `A | `B ] t | V2 : [ `C | `D ] t +# type _ t = V1 : [ `A | `B ] t | V2 : [ `C | `D ] t val f : 'a t -> 'a = <fun> # - : [ `A | `B ] = `A -# type 'a int_foo = IF_constr : < foo : int; .. > int_foo -type 'a int_bar = IB_constr : < bar : int; .. > int_bar +# type _ int_foo = IF_constr : < foo : int; .. > int_foo +type _ int_bar = IB_constr : < bar : int; .. > int_bar # Characters 98-99: (x:<foo:int>) ^ |
