aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorEnrico Tassi2013-12-24 18:20:22 +0100
committerEnrico Tassi2013-12-24 18:23:41 +0100
commita681e57e3c76dff2fe710ce533179ea659d8de0b (patch)
tree6e5a4d2f8aed9dc518fe3d9e6e87bd9600c9a67d /kernel
parent18c7a10341b462256b576542412db889d528465f (diff)
STM: capture type checking error (Closes: 3195)
Also, the future chain that reaches the kernel is greedy. If the user executes step by step, then the error is raised immediately.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/declareops.ml2
-rw-r--r--kernel/safe_typing.ml2
-rw-r--r--kernel/term_typing.ml4
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/declareops.ml b/kernel/declareops.ml
index 8eae2aed8e..724f290926 100644
--- a/kernel/declareops.ml
+++ b/kernel/declareops.ml
@@ -100,7 +100,7 @@ let hcons_const_def = function
Def (from_val (Term.hcons_constr constr))
| OpaqueDef lc ->
OpaqueDef
- (Future.chain ~pure:true lc
+ (Future.chain ~greedy:true ~pure:true lc
(fun lc -> opaque_from_val (Term.hcons_constr (force_opaque lc))))
let hcons_const_body cb =
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml
index 35da705efb..ac7a5bb937 100644
--- a/kernel/safe_typing.ml
+++ b/kernel/safe_typing.ml
@@ -379,7 +379,7 @@ let add_constant dir l decl senv =
(* In coqc, opaque constants outside sections will be stored
indirectly in a specific table *)
{ cb with const_body =
- OpaqueDef (Future.chain ~pure:true lc Lazyconstr.turn_indirect) }
+ OpaqueDef (Future.chain ~greedy:true ~pure:true lc Lazyconstr.turn_indirect) }
| _ -> cb
in
let senv' = add_field (l,SFBconst cb) (C kn) senv in
diff --git a/kernel/term_typing.ml b/kernel/term_typing.ml
index 554ed9f9b8..57d4a287b0 100644
--- a/kernel/term_typing.ml
+++ b/kernel/term_typing.ml
@@ -163,7 +163,7 @@ let build_constant_declaration kn env (def,typ,cst,inline_code,ctx) =
check declared inferred;
x
| OpaqueDef lc -> (* In this case we can postpone the check *)
- OpaqueDef (Future.chain ~pure:true lc (fun lc ->
+ OpaqueDef (Future.chain ~greedy:true ~pure:true lc (fun lc ->
let ids_typ = global_vars_set_constant_type env typ in
let ids_def =
global_vars_set env (Lazyconstr.force_opaque lc) in
@@ -198,7 +198,7 @@ let translate_local_def env id centry =
let translate_mind env kn mie = Indtypes.check_inductive env kn mie
let handle_side_effects env ce = { ce with
- const_entry_body = Future.chain ~pure:true
+ const_entry_body = Future.chain ~greedy:true ~pure:true
ce.const_entry_body (fun (body, side_eff) ->
handle_side_effects env body side_eff, Declareops.no_seff);
}