fix(frontends/lean/builtin_exprs): bug in 'using' construct
This commit is contained in:
parent
78d8e79000
commit
daf36803c4
2 changed files with 10 additions and 1 deletions
|
@ -289,7 +289,7 @@ static expr parse_proof(parser & p, expr const & prop) {
|
|||
buffer<expr> new_locals;
|
||||
while (!p.curr_is_token(get_comma_tk())) {
|
||||
auto id_pos = p.pos();
|
||||
expr l = p.parse_expr();
|
||||
expr l = p.parse_id();
|
||||
if (!is_local(l))
|
||||
throw parser_error("invalid 'using' declaration for 'have', local expected", id_pos);
|
||||
expr new_l = l;
|
||||
|
|
9
tests/lean/run/using_bug.lean
Normal file
9
tests/lean/run/using_bug.lean
Normal file
|
@ -0,0 +1,9 @@
|
|||
example (p q r : Prop) : p ∧ q ∧ r → q ∧ p :=
|
||||
assume Hpqr : p ∧ q ∧ r,
|
||||
have Hp : p, from and.elim_left Hpqr,
|
||||
have Hqr : q ∧ r, from and.elim_right Hpqr,
|
||||
have Hq : q, from and.elim_left Hqr,
|
||||
show q ∧ p, using Hp Hq, from
|
||||
proof
|
||||
and.intro Hq Hp
|
||||
qed
|
Loading…
Reference in a new issue