From 0bfe9f8d5cc80d02b56e1a92b3eb2ee86d2542e8 Mon Sep 17 00:00:00 2001 From: Jacques Garrigue Date: Aug 21 2014 07:57:29 +0000 Subject: Fix PR#6513: Fatal error Ctype.Unify(_) in functor type git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@15119 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- diff --git a/Changes b/Changes index 10470aa..22b392e 100644 --- a/Changes +++ b/Changes @@ -272,14 +272,18 @@ Bug fixes: (Benoît Vaugon) - PR#6436: Typos in @deprecated text in stdlib/arrayLabels.mli - PR#6443: ocaml segfault when List.fold_left is traced then executed + (Jacques Garrigue, report by Reventlov) - PR#6460: runtime assertion failure with large [| e1;...eN |] float array expressions (Leo White) - PR#6482: ocamlbuild fails when _tags file in unhygienic directory (Gabriel Scherer) - PR#6505: Missed Type-error leads to a segfault upon record access + (Jacques Garrigue, report by Christoph Höger) - PR#6509: add -linkall flag to ocamlcommon.cma (Frédéric Bour) +- PR#6513: Fatal error Ctype.Unify(_) in functor type + (Jacques Garrigue, report by Dario Teixeira) - fix -dsource printing of "external _pipe = ..." (Gabriel Scherer) - bound-checking bug in caml_string_{get,set}{16,32,64} diff --git a/testsuite/tests/typing-modules-bugs/pr6513_ok.ml b/testsuite/tests/typing-modules-bugs/pr6513_ok.ml new file mode 100644 index 0000000..f23fc59 --- /dev/null +++ b/testsuite/tests/typing-modules-bugs/pr6513_ok.ml @@ -0,0 +1,25 @@ +module type PR6513 = sig +module type S = sig type u end + +module type T = sig + type 'a wrap + type uri +end + +module Make: functor (Html5 : T with type 'a wrap = 'a) -> + S with type u = < foo : Html5.uri > +end + +(* Requires -package tyxml +module type PR6513_orig = sig +module type S = +sig + type t + type u +end + +module Make: functor (Html5: Html5_sigs.T with type 'a Xml.wrap = 'a and type 'a wrap = 'a and type 'a list_wrap = 'a list) -> S with + type t = Html5_types.div Html5.elt and + type u = < foo: Html5.uri > +end +*) diff --git a/typing/typemod.ml b/typing/typemod.ml index bfd744d..a053d53 100644 --- a/typing/typemod.ml +++ b/typing/typemod.ml @@ -515,6 +515,7 @@ let rec transl_modtype env smty = let ty_arg = Misc.may_map (fun m -> m.mty_type) arg in let (id, newenv) = Env.enter_module ~arg:true param.txt (Btype.default_mty ty_arg) env in + Ctype.init_def(Ident.current_time()); (* PR#6513 *) let res = transl_modtype newenv sres in mkmty (Tmty_functor (id, param, arg, res)) (Mty_functor(id, ty_arg, res.mty_type)) env loc