diff options
author | Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> | 2017-08-29 09:04:47 +0900 |
---|---|---|
committer | Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> | 2017-08-29 09:04:47 +0900 |
commit | 2165cca89fb25d80c111f409746c3efdc75aab7a (patch) | |
tree | e9d63dcf9488d8107e93cd85ccf93f77a4c491fc | |
parent | 83d4b6ccba165677b8260e5e83709e5893608494 (diff) | |
download | ocaml-2165cca89fb25d80c111f409746c3efdc75aab7a.tar.gz |
remove changes in ctype.ml and replace by a comment
-rw-r--r-- | typing/typecore.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/typing/typecore.ml b/typing/typecore.ml index 2732d83d36..74a82c355a 100644 --- a/typing/typecore.ml +++ b/typing/typecore.ml @@ -2800,7 +2800,7 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected = let (id, new_env) = Env.enter_module name.txt modl.mod_type env in Ctype.init_def(Ident.current_time()); Typetexp.widen context; - let body = type_expect new_env sbody (correct_levels ty_expected) in + let body = type_expect new_env sbody ty_expected in (* go back to original level *) end_def (); (* Unification of body.exp_type with the fresh variable ty @@ -2808,12 +2808,15 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected = i.e. if generative types rooted at id show up in the type body.exp_type. Thus, this unification enforces the scoping condition on "let module". *) + (* Note that this code will only be reached if ty_expected + is a generic type variable, otherwise the error will occur + above in type_expect *) begin try Ctype.unify_var new_env ty body.exp_type with Unify _ -> raise(Error(loc, env, Scoping_let_module(name.txt, body.exp_type))) end; - rue { + re { exp_desc = Texp_letmodule(id, name, modl, body); exp_loc = loc; exp_extra = []; exp_type = ty; |