summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Clerc <xavier.clerc@inria.fr>2011-07-21 07:34:14 +0000
committerXavier Clerc <xavier.clerc@inria.fr>2011-07-21 07:34:14 +0000
commit22a753340d9bbccb31112963db3a89ff3d0603d5 (patch)
tree11d4958f8faa82a38ac30aba305886eb5bc2b228
parent9cc18a5a7e0eac3b912bf1853954e2b747aebefe (diff)
test suite: 'implicit_unpack' moved from 'testlabl'.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testsuite/tests/typing-implicit_unpack/Makefile4
-rw-r--r--testsuite/tests/typing-implicit_unpack/implicit_unpack.ml (renamed from testlabl/implicit_unpack.ml)0
-rw-r--r--testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference49
3 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/tests/typing-implicit_unpack/Makefile b/testsuite/tests/typing-implicit_unpack/Makefile
new file mode 100644
index 000000000..5f42b7057
--- /dev/null
+++ b/testsuite/tests/typing-implicit_unpack/Makefile
@@ -0,0 +1,4 @@
+BASEDIR=../..
+include $(BASEDIR)/makefiles/Makefile.toplevel
+include $(BASEDIR)/makefiles/Makefile.common
+
diff --git a/testlabl/implicit_unpack.ml b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml
index db65dae3d..db65dae3d 100644
--- a/testlabl/implicit_unpack.ml
+++ b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml
diff --git a/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference
new file mode 100644
index 000000000..002d30c66
--- /dev/null
+++ b/testsuite/tests/typing-implicit_unpack/implicit_unpack.ml.reference
@@ -0,0 +1,49 @@
+
+# * * * * * * * * * val sort : (module Set.S with type elt = 'a) -> 'a list -> 'a list = <fun>
+val make_set : ('a -> 'a -> int) -> (module Set.S with type elt = 'a) = <fun>
+val sort_cmp : ('a -> 'a -> int) -> 'a list -> 'a list = <fun>
+module type S = sig type t val x : t end
+# val f : (module S with type t = int) -> int = <fun>
+# Characters 6-37:
+ let f (module M : S with type t = 'a) = M.x;; (* Error *)
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: The type of this packed module contains variables:
+(module S with type t = 'a)
+# val f : (module S with type t = 'a) -> 'a = <fun>
+# - : int = 1
+# type 'a s = { s : (module S with type t = 'a); }
+# - : int s = {s = <module>}
+# Characters 9-19:
+ let f {s=(module M)} = M.x;; (* Error *)
+ ^^^^^^^^^^
+Error: The type of this packed module contains variables:
+(module S with type t = 'a)
+# val f : 'a s -> 'a = <fun>
+# type s = { s : (module S with type t = int); }
+# val f : s -> int = <fun>
+# val f : s -> s -> int = <fun>
+# module type S = sig val x : int end
+# val f : (module S) -> int -> (module S) -> int = <fun>
+# Characters 8-37:
+ let m = (module struct let x = 3 end);; (* Error *)
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Error: The signature for this packaged module couldn't be inferred.
+# val m : (module S) = <module>
+# - : int = 7
+# - : int = 6
+# - : int = 3
+# Characters 4-14:
+ let (module M) = m;; (* Error: only allowed in [let .. in] *)
+ ^^^^^^^^^^
+Error: Modules are not allowed in this pattern.
+# Characters 14-24:
+ class c = let (module M) = m in object end;; (* Error again *)
+ ^^^^^^^^^^
+Error: Modules are not allowed in this pattern.
+# module M : S
+# module type S' = sig val f : int -> int end
+# - : int = 6
+#
+Characters 1465-1465:
+Error: Syntax error
+#