Skip to content

for-loop over constant DynArray fails to compile #4823

@cyberthirst

Description

@cyberthirst

Version Information

  • vyper Version (output of vyper --version): 0.4.4+commit.17322bb9

What's your issue about?

  • PoC:

    c: constant(DynArray[uint256, 10]) = [1, 2, 3]
    
    def foo():
        for i: uint256 in c:
            pass
  • Error:

    vyper.exceptions.TypeMismatch: Given reference has type DynArray[uint256, 10], expected uint256[3]
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions