diff options
-rw-r--r-- | kernel/safe_typing.ml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml index 636644ec3..753b97a0c 100644 --- a/kernel/safe_typing.ml +++ b/kernel/safe_typing.ml @@ -507,17 +507,18 @@ let add_module_parameter mbid mte inl senv = anomaly (Pp.str "Cannot add a module parameter to a non empty module") | _ -> () in - let mtb = translate_module_type senv.env (MPbound mbid) inl mte in - let senv = - full_add_module (module_body_of_type (MPbound mbid) mtb) senv + let mp = MPbound mbid in + let mtb = translate_module_type senv.env mp inl mte in + let senv = full_add_module (module_body_of_type mp mtb) senv in let new_variant = match senv.modinfo.variant with | STRUCT params -> STRUCT ((mbid,mtb) :: params) | SIG params -> SIG ((mbid,mtb) :: params) | _ -> - anomaly (Pp.str "Module parameters can only be added to modules or signatures") + let msg = "Module parameters can only be added to modules or signatures" + in anomaly (Pp.str msg) in - + let resolver_of_param = match mtb.typ_expr with SEBstruct _ -> mtb.typ_delta | _ -> empty_delta_resolver |