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

Parsing bug / Operator precedence issue? when destructuring #152

Open
stefandd opened this issue Aug 2, 2016 · 0 comments
Open

Parsing bug / Operator precedence issue? when destructuring #152

stefandd opened this issue Aug 2, 2016 · 0 comments

Comments

@stefandd
Copy link

stefandd commented Aug 2, 2016

Bug in Boo (tested with trunk 0.9.7 and 0.9.4):
Destructuring from returned lists works fine with regular variables, but not with fields of either classes or structs. From the error message "unexpected token: ,." I suspect an operator precedence issue.

def bar():    
    return [1, 2]

class foo:
    public a as int = 0
    public b as int = 0

struct zoo:
    public a as int = 0
    public b as int = 0

f = foo()
z = zoo()

// This works
a, b = bar()
print a, b // prints  "1 2" as expected

// This DOESN'T
f.a, f.b = bar() // BCE0043: Unexpected token: ,.

// This DOESN'T
z.a, z.b = bar() // BCE0043: Unexpected token: ,.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant