fix(frontends/lean): process choice-exprs at check_constant_next
This commit is contained in:
parent
c7406d6ce8
commit
a2e75159c8
2 changed files with 15 additions and 0 deletions
|
@ -1111,6 +1111,9 @@ name parser::check_constant_next(char const * msg) {
|
|||
e = get_explicit_arg(e);
|
||||
}
|
||||
|
||||
while (is_choice(e))
|
||||
e = get_choice(e, 0);
|
||||
|
||||
if (is_constant(e)) {
|
||||
return const_name(e);
|
||||
} else {
|
||||
|
|
12
tests/lean/run/const_choice.lean
Normal file
12
tests/lean/run/const_choice.lean
Normal file
|
@ -0,0 +1,12 @@
|
|||
import data.nat.basic
|
||||
open nat
|
||||
|
||||
definition pred (a : nat) : nat :=
|
||||
nat.cases_on a
|
||||
zero
|
||||
(fun a₁, a₁)
|
||||
|
||||
example : pred 1 = 0 :=
|
||||
rfl
|
||||
|
||||
print definition pred
|
Loading…
Reference in a new issue