aboutsummaryrefslogtreecommitdiff
path: root/toplevel
diff options
context:
space:
mode:
authorPierre Letouzey2015-06-22 14:53:31 +0200
committerPierre Letouzey2015-06-22 14:53:31 +0200
commit29fcfc4f8bc1bfbdfbae0c07850aed65f6c3eb04 (patch)
tree1e2edfae22c9f90ae4eceb8cf081df88a98b981e /toplevel
parent6bec099f8487b9d3ec5c44079cf69d3474c73b91 (diff)
parent4b6b4d8cdd12902d166504ec3d96ca94705d81f6 (diff)
Merge branch 'v8.5' into trunk
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/vernacentries.ml17
1 files changed, 8 insertions, 9 deletions
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml
index 188d2d098f..80fe26a817 100644
--- a/toplevel/vernacentries.ml
+++ b/toplevel/vernacentries.ml
@@ -102,17 +102,16 @@ let try_print_subgoals () =
let show_intro all =
let pf = get_pftreestate() in
let {Evd.it=gls ; sigma=sigma; } = Proof.V82.subgoals pf in
- let gl = {Evd.it=List.hd gls ; sigma = sigma; } in
- let l,_= decompose_prod_assum (strip_outer_cast (pf_concl gl)) in
- if all
- then
- let lid = Tactics.find_intro_names l gl in
- msg_notice (hov 0 (prlist_with_sep spc pr_id lid))
- else
- try
+ if not (List.is_empty gls) then begin
+ let gl = {Evd.it=List.hd gls ; sigma = sigma; } in
+ let l,_= decompose_prod_assum (strip_outer_cast (pf_concl gl)) in
+ if all then
+ let lid = Tactics.find_intro_names l gl in
+ msg_notice (hov 0 (prlist_with_sep spc pr_id lid))
+ else if not (List.is_empty l) then
let n = List.last l in
msg_notice (pr_id (List.hd (Tactics.find_intro_names [n] gl)))
- with Failure "List.last" -> ()
+ end
(** Prepare a "match" template for a given inductive type.
For each branch of the match, we list the constructor name