vyper Version (output of vyper --version): commit 4b4e188ba83d28b5dd6ff66479e7448e5b925030
Issue description
If a loop is defined over some non-literal static or dynamic array, the
type obtained from the annotation of the iterator is not used to
type-check the iterable. If the iterable's value type does not match the
annotation, the type-checker will miss it and the compiler will later
panic during code generation due to some assertion.
POC
For example, the following code crashes the compiler with
vyper.exceptions.CodegenPanic: unhandled exception , parse_For.
@external
@pure
def foo() :
s:int256[3] = [1,-1,1]
for i:uint256 in s:
print(i)
Version Information
vyper --version
): commit 4b4e188ba83d28b5dd6ff66479e7448e5b925030Issue description
If a loop is defined over some non-literal static or dynamic array, the type obtained from the annotation of the iterator is not used to type-check the iterable. If the iterable's value type does not match the annotation, the type-checker will miss it and the compiler will later panic during code generation due to some assertion.
POC
For example, the following code crashes the compiler with
vyper.exceptions.CodegenPanic: unhandled exception , parse_For
.credits: @trocher