aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2017-09-04 14:45:32 +0200
committerPierre-Marie Pédrot2017-09-04 14:46:12 +0200
commit818c49240f2ee6fccd38a556c7e90126606e1837 (patch)
tree5d297c37bb226660a1b927bda1f33b20b5c51d4a /src
parente634eb23010a3dee3fddcdd3d7d5588c3b40e1f6 (diff)
Fix coq/ltac2#17: Assertion failed. on only shelved goals remaining.
We check that the goal tactic is focussed before calling enter_one.
Diffstat (limited to 'src')
-rw-r--r--src/tac2core.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tac2core.ml b/src/tac2core.ml
index bbf95c7056..f4486bf0c8 100644
--- a/src/tac2core.ml
+++ b/src/tac2core.ml
@@ -116,6 +116,12 @@ let wrap f =
let wrap_unit f =
return () >>= fun () -> f (); return v_unit
+let assert_focussed =
+ Proofview.Goal.goals >>= fun gls ->
+ match gls with
+ | [_] -> Proofview.tclUNIT ()
+ | [] | _ :: _ :: _ -> throw err_notfocussed
+
let pf_apply f =
Proofview.Goal.goals >>= function
| [] ->
@@ -682,6 +688,7 @@ end
(** unit -> constr *)
let () = define0 "goal" begin
+ assert_focussed >>= fun () ->
Proofview.Goal.enter_one begin fun gl ->
let concl = Tacmach.New.pf_nf_concl gl in
return (Value.of_constr concl)