diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-07-17 15:31:40 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-07-17 15:31:40 +0000 |
commit | 66ffe00ed59e6bfcff4d29bdef8c1c1e3a8f5a64 (patch) | |
tree | e6f33159faf9b8a73fa8bf58cb21c41e6f32ff91 | |
parent | c8cb2a79223ccb9585d427764e5ca59b1c1f3c67 (diff) |
Safe_typing: minor factorisation
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16628 85f007b7-540e-0410-9357-904b9bb8a0f7
-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 |