Skip to content

Uncaught implicit any for computed property in destructure #26379

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
ghost opened this issue Aug 10, 2018 · 1 comment · Fixed by #26381 or #29053
Closed

Uncaught implicit any for computed property in destructure #26379

ghost opened this issue Aug 10, 2018 · 1 comment · Fixed by #26381 or #29053
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Aug 10, 2018

TypeScript Version: 3.1.0-dev.20180810

Code

let x: boolean;
({ ["a" + "b"]: x } = 0);
x = 0["a" + "b"];

Expected behavior:

Error on both lines.

Actual behavior:

Error only on 0["a" + "b"].

@ghost ghost added the Bug A bug in TypeScript label Aug 10, 2018
@ghost
Copy link
Author

ghost commented Aug 10, 2018

This happens because getTextOfPropertyName, used by checkObjectLiteralDestructuringPropertyAssignment, returns undefined for computed properties and we don't handle that correctly. So this is another bug due to #18217.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
2 participants