aboutsummaryrefslogtreecommitdiff
path: root/interp
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-05-22 17:46:37 +0200
committerPierre-Marie Pédrot2019-05-26 01:14:38 +0200
commit1e83ae578feea41d34c3ba26a1f74c3c715620a2 (patch)
treec67f5fd826c315191bfa666cd5e025ff396534cc /interp
parent51dc650f8b47a7381c19376793871817f2ef9578 (diff)
More precise type for Safe_typing export and inlining of private constants.
We get rid of the future wrappers, as all callers are immediately forcing the result.
Diffstat (limited to 'interp')
-rw-r--r--interp/declare.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/interp/declare.ml b/interp/declare.ml
index 7ee7ecb5e8..b3595b2dae 100644
--- a/interp/declare.ml
+++ b/interp/declare.ml
@@ -163,7 +163,8 @@ let define_constant ?role ?(export_seff=false) id cd =
not de.const_entry_opaque ||
is_poly de ->
(* This globally defines the side-effects in the environment. *)
- let de, export = Global.export_private_constants ~in_section de in
+ let body, export = Global.export_private_constants ~in_section (Future.force de.const_entry_body) in
+ let de = { de with const_entry_body = Future.from_val (body, ()) } in
export, ConstantEntry (PureEntry, DefinitionEntry de)
| _ -> [], ConstantEntry (EffectEntry, cd)
in
@@ -214,11 +215,10 @@ let cache_variable ((sp,_),o) =
let impl = if impl then Implicit else Explicit in
impl, true, poly, ctx
| SectionLocalDef (de) ->
- let (de, eff) = Global.export_private_constants ~in_section:true de in
- let () = List.iter register_side_effect eff in
(* The body should already have been forced upstream because it is a
section-local definition, but it's not enforced by typing *)
- let (body, uctx), () = Future.force de.const_entry_body in
+ let ((body, uctx), eff) = Global.export_private_constants ~in_section:true (Future.force de.const_entry_body) in
+ let () = List.iter register_side_effect eff in
let poly, univs = match de.const_entry_universes with
| Monomorphic_entry uctx -> false, uctx
| Polymorphic_entry (_, uctx) -> true, Univ.ContextSet.of_context uctx