Skip to content

Destructuring leaks in blocks (do/end in Lua) #790

@Validark

Description

@Validark
{
	const a = 1; // always works
	const [b] = [1]; // works on playground, breaks latest local version
	const { c } = { c: 1 }; // never works
}
-- Generated with latest TypeScriptToLua
do
    a = 1
    local b = 1
    local ____ = {c = 1}
    c = ____.c
end

https://typescripttolua.github.io/play#src=%7B%0A%09const%20a%20%3D%201%3B%20%2F%2F%20always%20works%0A%09const%20%5Bb%5D%20%3D%20%5B1%5D%3B%20%2F%2F%20works%20on%20playground%2C%20breaks%20latest%20local%20version%0A%09const%20%7B%20c%20%7D%20%3D%20%7B%20c%3A%201%20%7D%3B%20%2F%2F%20never%20works%0A%7D%0A

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