We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When 'this' is used as type it is replaced with the following interface or class.
class A { f(a : this) {} // <=> f(a : A) g(x : any) { if (x instanceof this) { } // <=> x instanceof A } interface B { x : this; // <=> x : B }
The text was updated successfully, but these errors were encountered:
This is actually a duplicate of #285 (and #1435).
For the record, this-type as an input type is not type safe, as I'll elaborate on in that issue.
this
Sorry, something went wrong.
Why not type safe? If this always resolves to the static type of the class it is purely type safe.
I understand the other proposals is to dynamically bind this to the real type beneath, I don't propose it. Maybe 'typeof this' makes it more clear.
No branches or pull requests
When 'this' is used as type it is replaced with the following interface or class.
The text was updated successfully, but these errors were encountered: