summaryrefslogtreecommitdiff
path: root/testsuite/tests/typing-modules/firstclass.ml.reference
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typing-modules/firstclass.ml.reference')
-rw-r--r--testsuite/tests/typing-modules/firstclass.ml.reference27
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/typing-modules/firstclass.ml.reference b/testsuite/tests/typing-modules/firstclass.ml.reference
new file mode 100644
index 0000000000..db376005a1
--- /dev/null
+++ b/testsuite/tests/typing-modules/firstclass.ml.reference
@@ -0,0 +1,27 @@
+
+# module type S = sig type u type t end
+# module type S' = sig type t = int type u = bool end
+# * val f : (module S with type t = int and type u = bool) -> (module S') = <fun>
+# val g : (module S with type t = int and type u = bool) -> (module S') = <fun>
+# module type S2 = sig type u type t type w end
+# val g2 : (module S2 with type t = int and type u = bool) -> (module S') =
+ <fun>
+# val h : (module S2 with type t = 'a) -> (module S with type t = 'a) = <fun>
+# Characters 63-64:
+ (x : (module S'));; (* fail *)
+ ^
+Error: This expression has type
+ (module S2 with type t = int and type u = bool)
+ but an expression was expected of type (module S')
+# Characters 46-47:
+ (x : (module S with type t = 'a));; (* fail *)
+ ^
+Error: This expression has type (module S2 with type t = 'a)
+ but an expression was expected of type (module S with type t = 'a)
+# module type S3 = sig type u type t val x : int end
+# Characters 13-78:
+ (x : (module S3 with type t = 'a and type u = 'b) :> (module S'));; (* fail *)
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: Type (module S3 with type t = int and type u = bool)
+ is not a subtype of (module S')
+#