aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/safe_typing.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml
index 22d45861e6..d8a00d7b76 100644
--- a/kernel/safe_typing.ml
+++ b/kernel/safe_typing.ml
@@ -118,12 +118,18 @@ type global_declaration =
| ConstantEntry of constant_entry
| GlobalRecipe of Cooking.recipe
+let hcons_constant_body cb =
+ { cb with
+ const_body = option_app hcons1_constr cb.const_body;
+ const_type = hcons1_constr cb.const_type }
+
let add_constant dir l decl senv =
check_label l senv.labset;
let cb = match decl with
ConstantEntry ce -> translate_constant senv.env ce
| GlobalRecipe r -> translate_recipe senv.env r
in
+ let cb = if dir = empty_dirpath then hcons_constant_body cb else cb in
let env' = Environ.add_constraints cb.const_constraints senv.env in
let kn = make_kn senv.modinfo.modpath dir l in
let env'' = Environ.add_constant kn cb env' in