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

Limit size of union types resulting from intersection type normalization #31572

Merged
merged 3 commits into from May 24, 2019

Conversation

ahejlsberg
Copy link
Member

@ahejlsberg ahejlsberg commented May 23, 2019

With this PR we estimate the size of union types created by intersection type normalization and issue an error if the estimate exceeds 100,000 constituent types. This ensures that we don't spend inordinate amounts of time and/or run out of memory.

Fixes #30050.

@ahejlsberg
Copy link
Member Author

@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 23, 2019

Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at f20a4fd. You can monitor the build here. It should now contribute to this PR's status checks.

@ahejlsberg
Copy link
Member Author

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 23, 2019

Heya @ahejlsberg, I've started to run the extended test suite on this PR at f20a4fd. You can monitor the build here. It should now contribute to this PR's status checks.

@weswigham
Copy link
Member

test case?

@ahejlsberg
Copy link
Member Author

@weswigham Yes, I'll include that as a test case. It does indeed error as expected.

@ahejlsberg
Copy link
Member Author

The RWC and DT runs look clean (issues are unrelated).

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should look at merging #31486 as well, so this error appears in fewer common react patterns.

@ahejlsberg ahejlsberg merged commit 7ff97d1 into master May 24, 2019
@ahejlsberg ahejlsberg deleted the normalizedIntersectionLimiter branch May 24, 2019 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tsc crash with node OOM
3 participants