Open trocher opened 1 week ago
vyper --version
python --version
When Indexing Bytes or String of different length, depending on the order of the elements in the List it can be that the compiler incorrectly fails to type check.
Bytes
String
List
Most likely related to #4079, #3253
@external def foo(): index: uint256 = 1 a: String[30] = "" b: String[257] = "" l1: String[257] = [b,a][index] # compiles l2: String[257] = [a,b][index] # does not compile
vyper.exceptions.TypeMismatch: Expected String[30][2] but literal can only be cast as DynArray[String[30], 2] or String[30][2].
h/t @ritzdorf
Probably by fixing compare_type for Bytes and Strings.
compare_type
Version Information
vyper --version
): 0.4.0python --version
): 3.11.4What's your issue about?
When Indexing
Bytes
orString
of different length, depending on the order of the elements in theList
it can be that the compiler incorrectly fails to type check.Most likely related to #4079, #3253
h/t @ritzdorf
How can it be fixed?
Probably by fixing
compare_type
for Bytes and Strings.