-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent shadowing of trait consts by contract vars (#480)
- Loading branch information
1 parent
b851a35
commit a98d4f4
Showing
4 changed files
with
32 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
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
13 changes: 13 additions & 0 deletions
13
src/types/test-failed/scope-storage-var-shadows-trait-const.tact
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,13 @@ | ||
primitive Int; | ||
|
||
trait BaseTrait { virtual const storageReserve: Int = 0; } | ||
|
||
contract Foo { | ||
// this should be a var-scope error because storageReserve | ||
// is a virtual constant defined in BaseTrait | ||
storageReserve: Int; | ||
|
||
init() { | ||
self.storageReserve = ton("0.05"); | ||
} | ||
} |