lean4-htt/tests/lean/run/localNameResolutionWithProj.lean
Leonardo de Moura 520a5f566a fix: local name resolution
Local name resolution was incorrect when identifier had macro scopes
and projections were used.

cc @Kha
2020-10-05 17:32:46 -07:00

15 lines
264 B
Text

new_frontend
macro "foo!" x:term : term => `(let xs := $x; xs.succ + xs)
def f1 (x : Nat) : Nat :=
foo! x+1
theorem ex1 (x : Nat) : f1 x = Nat.succ (x+1) + (x + 1) :=
rfl
def f2 (xs : Nat) : Nat :=
foo! xs
theorem ex2 (x : Nat) : f2 x = Nat.succ x + x :=
rfl