fix(frontends/lean/parser): fixes #770

This commit is contained in:
Leonardo de Moura 2015-08-08 09:48:31 -07:00
parent dc2e702373
commit 1f34c72192
3 changed files with 23 additions and 1 deletions

View file

@ -1418,7 +1418,7 @@ expr parser::parse_numeral_expr(bool user_notation) {
}
buffer<expr> cs;
if (*m_has_num)
cs.push_back(save_pos(from_num(n), p));
cs.push_back(save_pos(copy(from_num(n)), p));
for (expr const & c : vals)
cs.push_back(copy_with_new_pos(c, p));
// Remark: choices are processed from right to left.

20
tests/lean/770.hlean Normal file
View file

@ -0,0 +1,20 @@
open nat unit equiv eq
definition code : → Type₀
| code 0 0 := unit
| code (succ n) 0 := empty
| code 0 (succ m) := empty
| code (succ n) (succ m) := code n m
definition refl : Πn, code n n
| refl 0 := star
| refl (succ n) := refl n
definition encode (n m : ) : (n = m) ≃ code n m :=
equiv.MK (λp, sorry) -- p ▸ refl n)
(match n m with
| 0 0 := sorry
end)
sorry
sorry

View file

@ -0,0 +1,2 @@
770.hlean:17:14: error: function expected at
0