# type foo = .. # type bar = foo = .. # type baz = foo = .. # type bar += Bar1 of int # type baz += Bar2 of int # module M : sig type bar += Foo of float end # module type S = sig type baz += Foo of float end # module M_S : S # type foo = .. # type bar = foo # Characters 13-23: type bar += Bar of int (* Error: type is not open *) ^^^^^^^^^^ Error: Cannot extend type definition bar # Characters 6-20: type baz = bar = .. (* Error: type kinds don't match *) ^^^^^^^^^^^^^^ Error: This variant or record definition does not match that of type bar Their kinds differ. # type 'a foo = .. # Characters 6-32: type ('a, 'b) bar = 'a foo = .. (* Error: arrities do not match *) ^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: This variant or record definition does not match that of type 'a foo They have different arities. # type ('a, 'b) foo = .. # Characters 6-38: type ('a, 'b) bar = ('a, 'a) foo = .. (* Error: constraints do not match *) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: This variant or record definition does not match that of type ('a, 'a) foo Their constraints differ. # type foo = .. # Characters 24-25: type bar = private foo = .. (* ERROR: Private abstract types cannot be open *) ^ Error: Syntax error # module M : sig type foo = .. end # module type S = sig type foo end # module M_S : S # Characters 17-20: type M_S.foo += Foo (* ERROR: Cannot extend a type that isn't "open" *) ^^^ Error: Cannot extend type definition M_S.foo # module M : sig type foo end # module type S = sig type foo = .. end # Characters 15-16: module M_S = (M : S) (* ERROR: Signatures are not compatible *) ^ Error: Signature mismatch: Modules do not match: sig type foo = M.foo end is not included in S Type declarations do not match: type foo = M.foo is not included in type foo = .. Their kinds differ. # module M : sig type +'a foo = .. type 'a bar = 'a foo = .. end # module type S = sig type 'a foo = .. type 'a bar = 'a foo = .. end # Characters 15-16: module M_S = (M : S) (* ERROR: Signatures are not compatible *) ^ Error: Signature mismatch: Modules do not match: sig type 'a foo = 'a M.foo = .. type 'a bar = 'a foo = .. end is not included in S Type declarations do not match: type 'a foo = 'a M.foo = .. is not included in type 'a foo = .. Their variances do not agree. # type exn2 = exn = .. # Characters 61-79: let f = function Foo -> () ^^^^^^^^^^^^^^^^^^ Warning 8: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: _ Matching over values of extensible variant types must include a wild card pattern in order to be exhaustive. type foo = .. type foo += Foo val f : foo -> unit = #