-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Make identity comparison reflexive across unions or intersections of the same type #60868
base: main
Are you sure you want to change the base?
Make identity comparison reflexive across unions or intersections of the same type #60868
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
70d3914
to
7b7a9b2
Compare
@jakebailey @RyanCavanaugh don't know if there's any interest in this, but mind kicking off tests? |
I can at least run the tests @typescript-bot test it |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Please verify that:
Backlog
milestone (required) - No one has created an issue for this specifically, but it is a subset of a larger set of problems discussed in [Feature request]type level equal operator #27024 and can be seen as complementary to Merge trivially mergeable intersection types for identity comparison #60726main
branchhereby runtests
locally#60726 (comment) points out why some type testing libraries define equality with a definition like:
rather than just
which is that types like
{a: 1}
are not considered identical to types like{a: 1} & {a: 1}
and{a: 1} | {a: 1}
.The latter definition of
Equals
is required to enable #60726, so I've made this PR to eliminate the need for the former definition ofEquals
.