fix(frontends/lean/elaborator): fixes #982

This commit is contained in:
Leonardo de Moura 2016-02-04 15:14:30 -08:00
parent 774fa01b1a
commit 496c84dac6
2 changed files with 19 additions and 1 deletions

View file

@ -2395,7 +2395,7 @@ static expr translate_local_name(environment const & env,
*/
static expr translate(environment const & env, list<expr> const & ctx, expr const & e) {
auto fn = [&](expr const & e) {
if (is_placeholder(e) || is_by(e)) {
if (is_placeholder(e) || is_by(e) || is_by_plus(e)) {
return some_expr(e); // ignore placeholders
} else if (is_constant(e)) {
expr new_e = copy_tag(e, translate_local_name(env, ctx, const_name(e), e));

18
tests/lean/run/982.lean Normal file
View file

@ -0,0 +1,18 @@
import data.nat
open nat
constant P : nat → Prop
example (Hex : ∃ n, P n) : true :=
obtain n Hn, from Hex,
begin+
note Hn2 := Hn,
exact trivial
end
example (Hex : ∃ n, P n) : true :=
obtain n Hn, from Hex,
begin+
have H : n ≥ 0, from sorry,
exact trivial
end