Skip to content

Commit

Permalink
Backport PR coq#11241: Unfortunate Coq 8.10 bug with "cofix with" tac…
Browse files Browse the repository at this point in the history
…tic syntax
  • Loading branch information
ppedrot committed Dec 7, 2019
2 parents 61a2ada + 7eeb0d2 commit 58b346a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
@@ -0,0 +1,4 @@
- **Fixed:**
Syntax of tactic `cofix ... with ...` was broken from Coq 8.10.
(`#11241 <https://github.com/coq/coq/pull/11241>`_,
by Hugo Herbelin).
2 changes: 1 addition & 1 deletion plugins/ltac/g_tactic.mlg
Expand Up @@ -135,7 +135,7 @@ let mk_cofix_tac (loc,id,bl,ann,ty) =
~hdr:"Constr:mk_cofix_tac"
(Pp.str"Annotation forbidden in cofix expression.")) ann in
let bl = List.map (fun (nal,bk,t) -> CLocalAssum (nal,bk,t)) bl in
(id,CAst.make ~loc @@ CProdN(bl,ty))
(id,if bl = [] then ty else CAst.make ~loc @@ CProdN(bl,ty))

(* Functions overloaded by quotifier *)
let destruction_arg_of_constr (c,lbind as clbind) = match lbind with
Expand Down
4 changes: 0 additions & 4 deletions test-suite/success/RecTutorial.v
Expand Up @@ -1210,7 +1210,3 @@ Proof.
constructor.
trivial.
Qed.




10 changes: 10 additions & 0 deletions test-suite/success/cofixtac.v
@@ -0,0 +1,10 @@
CoInductive stream :=
| C : content -> stream
with content :=
| D : nat -> stream -> content.

Lemma one : stream.
cofix c with (d : content).
- constructor. apply d.
- constructor. exact 1. apply c.
Defined.

0 comments on commit 58b346a

Please sign in to comment.