Skip to content

Downlevel destructuring for parameter properties emits incorrectly #1540

@DanielRosenwasser

Description

@DanielRosenwasser
class C {
    constructor(public [x, y, z]: string[]) {
    }
}

Emitted code:

var C = (function () {
    function C(_a) {
        var x = _a[0], y = _a[1], z = _a[2];
        this.[x, y, z] = [x, y, z];
    }
    return C;
})();

Clearly this.[x,y,z] is not legal.

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions