Skip to content

Fix crash by leveraging existing function for finding spread validity#21564

Merged
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-esmodule-flags-crash
Feb 2, 2018
Merged

Fix crash by leveraging existing function for finding spread validity#21564
weswigham merged 1 commit into
microsoft:masterfrom
weswigham:fix-esmodule-flags-crash

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes #21554

An intersection type with no alias has no symbol, which triggered the above bug. Now, this PR just leverages an existing function for checking the validity of a type in a spread, rather than attempting to infer from the type's symbol if it could be spread. This is potentially more work than is required (since module exports are all top level types, we know that many generic types can't exist, so don't need to bother checking), but is better because of the consolidation of functionality.

@weswigham weswigham requested review from mhegazy and sandersn February 2, 2018 01:26
@weswigham weswigham merged commit b3ec8cc into microsoft:master Feb 2, 2018
@weswigham weswigham deleted the fix-esmodule-flags-crash branch February 2, 2018 18:11
weswigham added a commit to weswigham/TypeScript that referenced this pull request Feb 2, 2018
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Feb 2, 2018

Please port this to release-2.7 as well.

@weswigham
Copy link
Copy Markdown
Member Author

@mhegazy way ahead of you ;)

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants