Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Defer resolution of conditional types with generic check or extends types#28851

Merged
ahejlsberg merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
deferConditionalTypesmicrosoft/TypeScript:deferConditionalTypesCopy head branch name to clipboard
Dec 4, 2018
Merged

Defer resolution of conditional types with generic check or extends types#28851
ahejlsberg merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
deferConditionalTypesmicrosoft/TypeScript:deferConditionalTypesCopy head branch name to clipboard

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

With this PR we always defer resolution of conditional types when one or both of the check and extends types are generic (as determined by TypeFlags.Instantiable). Now, only when neither is generic do we perform further assignability checks to see if we can resolve a conditional type.

Fixes #28824.

@weswigham weswigham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With this change, distributivity is down to only affecting conditional type instantiation and constraints (which mostly follow from instantiation). I like more things not making the distinction between the distributive/nondistributive variants.

@ahejlsberg ahejlsberg merged commit b34c73f into master Dec 4, 2018
@ahejlsberg ahejlsberg deleted the deferConditionalTypes branch December 4, 2018 23:49
@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.

Nested Exclude has unexpected behavior

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.