-
-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: indexing into literal list (#3378)
a regression was introduced in 046ea16 whereby the following contract used to compile but now panics: ``` @external def foo(): f: uint256 = 1 a:bool = 1 == [1,2,4][f] + -1 ``` ``` AssertionError: unreachable, uint256 != int8 ``` the issue was that, previously, different integer types in vyper were represented by different types in python. however, now all integer types inherit from `IntegerT`. this commit fixes the issue by using the correct (and hygienically appropriate) `type.compare_type(other)`, instead of checking python-level type equality. the lark grammar also needed to be changed to enable accessing a literal list directly. --------- Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
- Loading branch information
1 parent
8c8124b
commit 97ff017
Showing
3 changed files
with
19 additions
and
3 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