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

be careful around type aliases in @implements #336

Merged
merged 1 commit into from Jan 21, 2017
Merged

Conversation

evmar
Copy link
Contributor

@evmar evmar commented Jan 20, 2017

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.

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}
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.

@evmar evmar merged commit 660f4c0 into master Jan 21, 2017
@evmar evmar deleted the interface-collision branch January 21, 2017 00:55
evmar added a commit that referenced this pull request Jan 26, 2017
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)
LucasSloan pushed a commit that referenced this pull request Feb 2, 2017
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)
LucasSloan pushed a commit that referenced this pull request Feb 3, 2017
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants