Skip to content

Downlevel destructuring for parameter properties emits incorrectly #1540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DanielRosenwasser opened this issue Dec 20, 2014 · 1 comment
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@DanielRosenwasser
Copy link
Member

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.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 15, 2015

Based on our offline discussion, this should not be allowed.

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jan 15, 2015
@mhegazy mhegazy closed this as completed Jan 15, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants