-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: global definition shadowing a local one when using dot-notation
closes #3079
- Loading branch information
1 parent
bd45c0c
commit 2f69034
Showing
2 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
def foo : Nat := 1 | ||
|
||
def bar : Nat := | ||
let rec foo := 10 | ||
foo.add 1 | ||
|
||
def baz : Nat := | ||
.add foo 1 | ||
where | ||
foo := 10 | ||
|
||
def bar2 : Nat := | ||
foo.add 1 | ||
where | ||
foo := 10 | ||
|
||
/-- | ||
info: 11 | ||
-/ | ||
#guard_msgs in | ||
#eval bar -- 11 | ||
/-- | ||
info: 11 | ||
-/ | ||
#guard_msgs in | ||
#eval baz -- 11 | ||
/-- | ||
info: 11 | ||
-/ | ||
#guard_msgs in | ||
#eval bar2 | ||
|
||
def bla.aux := 1 | ||
def bla : Nat → Nat | ||
| n => n + bla.aux -- should not be interpreted as `(bla).aux` | ||
|
||
/-- | ||
info: 4 | ||
-/ | ||
#guard_msgs in | ||
#eval bla 3 | ||
|
||
def boo : Nat := | ||
let n := 0 | ||
n.succ + (m |>.succ) + m.succ | ||
where | ||
m := 1 | ||
|
||
example : boo = 5 := rfl |