Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't loop over a nested array #1709

Closed
smarx opened this issue Nov 9, 2019 · 2 comments · Fixed by #1804
Closed

Can't loop over a nested array #1709

smarx opened this issue Nov 9, 2019 · 2 comments · Fixed by #1804
Labels
bug Bug that shouldn't change language semantics when fixed.

Comments

@smarx
Copy link
Contributor

smarx commented Nov 9, 2019

for loops in Vyper can loop over arrays, but not if they're nested. This code fails to compile with the surprising error 'Subscript' object has no attribute 'func':

@public
def __init__():
    x: uint256[5][2] = [[0, 1, 2, 3, 4], [2, 4, 6, 8, 10]]
    for i in x[1]:
        pass
@fubuloubu
Copy link
Member

Seems weird, buy maybe we should allow. Should also check to see if it affects arrays in structs

@fubuloubu fubuloubu added the VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting label Nov 10, 2019
@jacqueswww
Copy link
Contributor

jacqueswww commented Nov 11, 2019

Meeting Notes: This should be allowed eventually but currently should throw a cleaner error.

@fubuloubu fubuloubu added bug Bug that shouldn't change language semantics when fixed. and removed VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting labels Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that shouldn't change language semantics when fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants