-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28433 from ProvableHQ/shadowing
Disallow local variables from shadowing functions, structs, mappings,…
- Loading branch information
Showing
14 changed files
with
140 additions
and
63 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
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
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
14 changes: 14 additions & 0 deletions
14
tests/expectations/compiler/function/variable_shadow_function_fail.out
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,14 @@ | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
outputs = [""" | ||
Error [EAST0372006]: function `f1` shadowed by | ||
--> compiler-test:9:13 | ||
| | ||
9 | let f1: u8 = 1u8; | ||
| ^^ | ||
Error [ETYC0372005]: Unknown variable `f1` | ||
--> compiler-test:10:16 | ||
| | ||
10 | return f1; | ||
| ^^ | ||
"""] |
14 changes: 14 additions & 0 deletions
14
tests/expectations/compiler/mappings/variable_shadow_mapping_fail.out
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,14 @@ | ||
namespace = "Compile" | ||
expectation = "Fail" | ||
outputs = [""" | ||
Error [EAST0372009]: variable `m` shadowed by | ||
--> compiler-test:7:13 | ||
| | ||
7 | let m: u8 = 1u8; | ||
| ^ | ||
Error [ETYC0372003]: Expected type `u8` but type `(u8 => u8)` was found | ||
--> compiler-test:8:16 | ||
| | ||
8 | return m; | ||
| ^ | ||
"""] |
Oops, something went wrong.