Skip to content

Incorrect downlevel compilation for block scoped bindings captured in class initializers #7714

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
vladima opened this issue Mar 28, 2016 · 1 comment
Labels
Bug A bug in TypeScript
Milestone

Comments

@vladima
Copy link
Contributor

vladima commented Mar 28, 2016

let ar = [];
for (let i = 0; i < 2; i++) {
  ar.push(class { x = i; });
}
console.log(new ar[0]().x); // should this be 0, now prints 2
console.log(new ar[1]().x); // should this be 1, now prints 2
@vladima vladima self-assigned this Mar 28, 2016
@vladima vladima added the Bug A bug in TypeScript label Mar 28, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, TypeScript 2.0 Jun 7, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, Future Sep 29, 2016
@mhegazy mhegazy assigned mhegazy and unassigned vladima Mar 24, 2017
@jakebailey
Copy link
Member

Just looking at old issues; this one is the same as #8578 and was also fixed by #43197.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants