Skip to content

Conversation

@weswigham
Copy link
Member

@weswigham weswigham commented Mar 16, 2020

Fixes #37344

When we started "normalizing" deferred type aliases at the start of comparisons (#35266), we started to eagerly pull on them when we constructed conditional types around them (as conditionals eagerly check to see if they can simplify to their branches in some cases), which means that that normalization actually broke some very common patterns (like the generic action alias in the linked issue). To avoid that break, while still performing that normalization, in this PR, we now unconditionally defer conditionals where the check or extends type is itself a deferred type reference, and then later on perform the simplification of the conditional as part of getReducedType (introduced in #36696), so that deferral isn't witnessed by most consumers of the type.

@weswigham
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 16, 2020

Heya @weswigham, I've started to run the perf test suite on this PR at ea74958. You can monitor the build here.

@sandersn sandersn added the For Milestone Bug PRs that fix a bug with a specific milestone label Apr 1, 2020
@sandersn sandersn assigned ahejlsberg and unassigned weswigham Apr 1, 2020
@weswigham weswigham closed this Apr 20, 2020
@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

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Recursive type alias in union type breaks in 3.8.3

4 participants