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
be careful around type aliases in @implements #336
Conversation
It's legal to @implements a type alias, but we need to be careful to not @implements a type alias that maps back to a symbol that we didn't emit a type for due to the symbol being both a type and a value. Yikes! To ensure I got this right, I added both a test for: - implementing an ordinary interface via an alias - a more complex reproduction of the zone issue Fixes #333 harder.
/** @typedef {!Interface} */ | ||
var TypeAlias; | ||
/** | ||
* @implements {TypeAlias} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: here is where we successfully implement a type alias.
} | ||
/** @typedef {?} */ | ||
var ZoneAlias; | ||
class ZoneImplementsAlias { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this class (and the one above it) both don't @implements anything, due to the interface not existing.
The "Zone" library uses a pattern that is deeply incompatible with tsickle in such a way that making this work is hard. For now, let's revert @implements so that we can move forward on importing TS2.1. This reverts: 660f4c0 be careful around type aliases in @implements (#336) 2255b53 don't emit @implements on non-types (#334) c9fc5c8 add @implements tag on "implements" clauses (#329)
The "Zone" library uses a pattern that is deeply incompatible with tsickle in such a way that making this work is hard. For now, let's revert @implements so that we can move forward on importing TS2.1. This reverts: 660f4c0 be careful around type aliases in @implements (#336) 2255b53 don't emit @implements on non-types (#334) c9fc5c8 add @implements tag on "implements" clauses (#329)
The "Zone" library uses a pattern that is deeply incompatible with tsickle in such a way that making this work is hard. For now, let's revert @implements so that we can move forward on importing TS2.1. This reverts: 660f4c0 be careful around type aliases in @implements (#336) 2255b53 don't emit @implements on non-types (#334) c9fc5c8 add @implements tag on "implements" clauses (#329)
It's legal to @implements a type alias, but we need to be careful
to not @implements a type alias that maps back to a symbol that
we didn't emit a type for due to the symbol being both a type
and a value. Yikes!
To ensure I got this right, I added both a test for:
Fixes #333 harder.