-
Notifications
You must be signed in to change notification settings - Fork 109
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
Tsickle emits bound this
generics which trigger jscompiler whitelist conformance checks
#1015
Comments
I ran into this recently. Adding an explicit cast (e.g. If tsickle automatically emitted the type assertion, both on static methods (because of google/closure-compiler#3340) and when a function has an explicit |
I see - the problem is that |
The reason Closure cares about what 'this' is at all is so it can consistently rename/DCE against it. For a bounded generic, we could say |
I think we do some monkeying with what 'this' refers to already in code like here: tsickle/src/jsdoc_transformer.ts Line 624 in e75e576
And in fact we insert explicit casts ourselves, kinda like what @rictic did, in some cases: tsickle/src/jsdoc_transformer.ts Line 634 in e75e576
I suspect it wouldn't be so hard to peek at the |
Closure also has support for generic bounds now.
|
If I followed the bug, this isn't even about generic bounds really. It's that code like /**
* @template T
*/
function f() {
/** @this {T} */
function f2() {}
} fails because you can't use a templated type in a |
m getting a conformance check error with a generic this value:
As far as I can tell, this is sensible:
But I am getting:
The text was updated successfully, but these errors were encountered: