Skip to content

Limit inference from apparent types to one level deep#27225

Merged
weswigham merged 3 commits intomicrosoft:masterfrom
weswigham:artifical-inferernce-limit
Sep 20, 2018
Merged

Limit inference from apparent types to one level deep#27225
weswigham merged 3 commits intomicrosoft:masterfrom
weswigham:artifical-inferernce-limit

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes the OOM in our fp-ts internal RWC test. There's no regression test for this because there was no bug. If you gave the process a handful of extra memory - 100MB more (roughly the overhead of our test harness itself) the build completes just fine with the original change (#27015) as-is (and, in fact, outside of the harness it does still build!). The change was simply enough to push a test already near the memory limit right over the edge.

Limiting inference from apparent types to one layer deep prevents us from using too many more resources, and isn't observably different in most cases (you'd need a type variable that simplifies to a union which contains a type variable which itself simplifies to something which you want to perform inference on to notice the difference - not something which happens at all in our harness!). In any case, this keeps #25274 fixed and the bug this limiter introduces should be difficult to reproduce in the wild (and would have also been a bug in 3.0, so isn't a regression yet).

@weswigham
Copy link
Copy Markdown
Member Author

@typescript-bot test this

@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Sep 20, 2018
@weswigham weswigham merged commit 928bff9 into microsoft:master Sep 20, 2018
@weswigham weswigham deleted the artifical-inferernce-limit branch September 20, 2018 22:00
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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.

2 participants