Skip to content

Table Comprehension Leads to Silent Error in Destructuring Assignment #391

Open
@turbo

Description

@turbo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions