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

Table Comprehension Leads to Silent Error in Destructuring Assignment #391

Open
turbo opened this issue Jul 24, 2019 · 1 comment
Open
Labels

Comments

@turbo
Copy link

turbo commented Jul 24, 2019

Receivers in LHS will be nil when destructuring is used on table comprehensions. No error emitted by the compiler:

foo = "1 2 foobar"

-- works as expected:
items = [ w for w in foo\gmatch("%S+") ]
{one, two, three} = items

-- all receivers nil:
{one, two, three} = [ w for w in foo\gmatch("%S+") ]

This contradicts other behavior where table comprehension expressions can be used instead of variable identifiers which contain tables.

@fwcd
Copy link

fwcd commented Dec 12, 2023

Possibly a dupe: #449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants