summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/typing-sigsubst/sigsubst.ml5
-rw-r--r--typing/typemod.ml3
2 files changed, 6 insertions, 2 deletions
diff --git a/testsuite/tests/typing-sigsubst/sigsubst.ml b/testsuite/tests/typing-sigsubst/sigsubst.ml
index 4cb22fa2d..6759f63ab 100644
--- a/testsuite/tests/typing-sigsubst/sigsubst.ml
+++ b/testsuite/tests/typing-sigsubst/sigsubst.ml
@@ -9,7 +9,7 @@ end;;
module type PrintableComparable = sig
include Printable
include Comparable with type t = t
-end;;
+end;; (* Fails *)
module type PrintableComparable = sig
type t
include Printable with type t := t
@@ -35,3 +35,6 @@ module type S =
sig module T : sig type exp type arg end val f : T.exp -> T.arg end;;
module M = struct type exp = string type arg = int end;;
module type S' = S with module T := M;;
+
+
+module type S = sig type 'a t end with type 'a t := unit;; (* Fails *)
diff --git a/typing/typemod.ml b/typing/typemod.ml
index 612cd165c..406c31865 100644
--- a/typing/typemod.ml
+++ b/typing/typemod.ml
@@ -203,7 +203,8 @@ let merge_constraint initial_env loc sg lid constr =
match !real_id with None -> assert false | Some id -> id in
let lid =
try match sdecl.ptype_manifest with
- | Some {ptyp_desc = Ptyp_constr (lid, stl)} ->
+ | Some {ptyp_desc = Ptyp_constr (lid, stl)}
+ when List.length stl = List.length sdecl.ptype_params ->
let params =
List.map
(function {ptyp_desc=Ptyp_var s} -> s | _ -> raise Exit)