Skip to content

Incorrect statement order in binding patterns in rest binding #477

Description

@ark120202

Input:

declare function foo(cb: (...args: number[]) => void): void;
foo((...[a, b]) => {});

Current Result:

foo(function(...)
    local a = ____TS_bindingPattern0[1];
    local b = ____TS_bindingPattern0[2];
    local ____TS_bindingPattern0 = ({...});
end);

Expected Result:

foo(function(...)
    local ____TS_bindingPattern0 = ({...});
    local a = ____TS_bindingPattern0[1];
    local b = ____TS_bindingPattern0[2];
end);

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