Skip to content

Using spread in object destructuring ignores property with the same name as spread identifier #898

@ark120202

Description

@ark120202

Playground

Input:

const { x, ...y } = { x: 1, y: 1, z: 1 };

Current Result:

local ____ = {x = 1, y = 1, z = 1}
x = ____.x
y = __TS__ObjectRest(____, {x = true, y = true})

Expected Result:

local ____ = {x = 1, y = 1, z = 1}
x = ____.x
y = __TS__ObjectRest(____, {x = true})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions