parent
d39478a028
commit
5f1d827b26
3 changed files with 5 additions and 1 deletions
|
@ -510,7 +510,7 @@ static void validate_equation_lhs(parser const & p, expr const & lhs, buffer<exp
|
||||||
std::any_of(locals.begin(), locals.end(), [&](expr const & local) {
|
std::any_of(locals.begin(), locals.end(), [&](expr const & local) {
|
||||||
return mlocal_name(e) == mlocal_name(local);
|
return mlocal_name(e) == mlocal_name(local);
|
||||||
})) {
|
})) {
|
||||||
throw parser_error(sstream() << "invalid occurrence of variable '" << mlocal_name(lhs) <<
|
throw parser_error(sstream() << "invalid occurrence of variable '" << mlocal_name(e) <<
|
||||||
"' in the left-hand-side of recursive equation", p.pos_of(lhs));
|
"' in the left-hand-side of recursive equation", p.pos_of(lhs));
|
||||||
}
|
}
|
||||||
return has_local(e);
|
return has_local(e);
|
||||||
|
|
3
tests/lean/match_bug.lean
Normal file
3
tests/lean/match_bug.lean
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
definition foo : nat -> nat := fun x,
|
||||||
|
match x with
|
||||||
|
| bar -> bar
|
1
tests/lean/match_bug.lean.expected.out
Normal file
1
tests/lean/match_bug.lean.expected.out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
match_bug.lean:3:6: error: invalid occurrence of variable 'bar' in the left-hand-side of recursive equation
|
Loading…
Reference in a new issue