Skip to content

Remove the rule that replaces a union of literal types with the base type when comparing equality to a type that isn't a union of literal types.#27588

Merged
RyanCavanaugh merged 1 commit intomicrosoft:masterfrom
mattmccutchen:issue-26758
Apr 23, 2019
Merged

Conversation

@mattmccutchen
Copy link
Copy Markdown
Contributor

The rule is redundant because a primitive type is already directed-
comparable to a value of that primitive type, and it causes errors to be
missed when comparing a type parameter constrained by a union of
literal types to another union of literal types.

The baseline changes look like improvements to me.

Fixes #26758.

@RyanCavanaugh
Copy link
Copy Markdown
Member

@mattmccutchen I think this is good to merge once the merge conflict is resolved. Sorry for the delay

@RyanCavanaugh RyanCavanaugh self-assigned this Jan 25, 2019
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Jan 25, 2019
type when comparing equality to a type that isn't a union of literal
types.

The rule is redundant because a primitive type is already directed-
comparable to a value of that primitive type, and it causes errors to be
missed when comparing a type parameter _constrained_ by a union of
literal types to another union of literal types.

The baseline changes look like improvements to me.

Fixes microsoft#26758.
@mattmccutchen
Copy link
Copy Markdown
Contributor Author

Updated to master.

@RyanCavanaugh RyanCavanaugh merged commit 6487d1f into microsoft:master Apr 23, 2019
@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.

Generic type is not expanded when typechecking equality check

2 participants