-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(name resolution): prevent name collisions with builtins when res…
…olving namespaces
- Loading branch information
Showing
4 changed files
with
22 additions
and
0 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
3 changes: 3 additions & 0 deletions
3
tests/unittests/resources/DiagnosticsSuite/compileTime/name_collision_with_builtin.ark
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,3 @@ | ||
(import package.list :reverse) | ||
|
||
(print (reverse [1 2 3])) |
7 changes: 7 additions & 0 deletions
7
tests/unittests/resources/DiagnosticsSuite/compileTime/name_collision_with_builtin.expected
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,7 @@ | ||
At reverse @ 3:9 | ||
1 | (import package.list :reverse) | ||
2 | | ||
3 | (print (reverse [1 2 3])) | ||
| ^~~~~~~ | ||
4 | | ||
Symbol `reverse' was resolved to `list:reverse', which is also a builtin name. Either the symbol or the package it's in needs to be renamed to avoid conflicting with the builtin. |
1 change: 1 addition & 0 deletions
1
tests/unittests/resources/DiagnosticsSuite/compileTime/package/list.ark
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 @@ | ||
(let reverse (fun (l) l)) |