-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
can’t use 'this' in object literals with --noImplicitThis #10835
Labels
Question
An issue which isn't directly actionable in code
Comments
Thanks. I gave up searching duplicates on page 2 of 50.
when |
Well, if you have let literal = {
a: 1,
getA(this: any) {
return this.a
},
} |
keithamoss
added a commit
to ealgis/ealgis
that referenced
this issue
Jun 21, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
TypeScript Version: 2.1.0-dev.20160910
Code
Expected behavior: there is a way to use
this
in an object literal whilenoImplicitThis
enabledActual behavior: an error is shown, even with
getA: function(this: this)
notationThe text was updated successfully, but these errors were encountered: