Skip to content
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

Make this in object literal always of type any #8389

Merged
merged 2 commits into from
Apr 30, 2016

Conversation

sandersn
Copy link
Member

Fixes #8191 again, but re-breaks #8110 and #7801.

Previously, this was implicitly typed by the shape of its containing object literal.
This is not correct for JavaScript-style inheritance uses of object literals, and the previous fix was not correct either.
So we're going back to this: any in object literals for now.

Previously, `this` was implicitly typed by the shape of its containing object literal.
This is not correct for JavaScript-style inheritance uses of object literals, and the previous fix was not correct either.
So we're going back to `this: any` in object literals for now.
@sandersn
Copy link
Member Author

@ahejlsberg and @mhegazy here is the reversion to this:any in object literals. thisInObjectLiterals is the most interesting test since it specifically tests this case.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 29, 2016

third time is a charm..

can we add a test for --noImplicitThis

@mhegazy
Copy link
Contributor

mhegazy commented Apr 29, 2016

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect/overly strong this inference for POJOs
3 participants