aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/mod_typing.ml
diff options
context:
space:
mode:
authorGravatar Pierre Letouzey <pierre.letouzey@inria.fr>2015-10-25 14:58:39 +0100
committerGravatar Pierre Letouzey <pierre.letouzey@inria.fr>2015-10-25 14:58:39 +0100
commit83e82ef7b42f47d63d3b40b2698695a0e7b2d685 (patch)
treeef1ab4f39e6aec01d6ab5a37beed8709204711ac /kernel/mod_typing.ml
parentc2de48c3f59415eaf0f2cbb5cfe78f23e908a459 (diff)
Safe_typing: add clean_bounded_mod_expr in Include Self of modtype (fix #4331)
Diffstat (limited to 'kernel/mod_typing.ml')
-rw-r--r--kernel/mod_typing.ml12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/mod_typing.ml b/kernel/mod_typing.ml
index eef83ce74..c03c5175f 100644
--- a/kernel/mod_typing.ml
+++ b/kernel/mod_typing.ml
@@ -351,12 +351,20 @@ let translate_module env mp inl = function
let restype = Option.map (fun ty -> ((params,ty),inl)) oty in
finalize_module env mp t restype
-let rec translate_mse_incl env mp inl = function
+let rec translate_mse_inclmod env mp inl = function
|MEident mp1 ->
let mb = strengthen_and_subst_mb (lookup_module mp1 env) mp true in
let sign = clean_bounded_mod_expr mb.mod_type in
sign,None,mb.mod_delta,Univ.ContextSet.empty
|MEapply (fe,arg) ->
- let ftrans = translate_mse_incl env mp inl fe in
+ let ftrans = translate_mse_inclmod env mp inl fe in
translate_apply env inl ftrans arg (fun _ _ -> None)
|MEwith _ -> assert false (* No 'with' syntax for modules *)
+
+let translate_mse_incl is_mod env mp inl me =
+ if is_mod then
+ translate_mse_inclmod env mp inl me
+ else
+ let mtb = translate_modtype env mp inl ([],me) in
+ let sign = clean_bounded_mod_expr mtb.mod_type in
+ sign,None,mtb.mod_delta,mtb.mod_constraints