Only normalize intersections that include {}#50535
Conversation
|
@typescript-bot test this |
|
Heya @ahejlsberg, I've started to run the extended test suite on this PR at 698c3ab. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at 698c3ab. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at 698c3ab. You can monitor the build here. Update: The results are in! |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at 698c3ab. You can monitor the build here. |
|
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 698c3ab. You can monitor the build here. |
|
@ahejlsberg Here are the results of running the user test suite comparing Everything looks good! |
|
Heya @ahejlsberg, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
|
@ahejlsberg Here they are:Comparison Report - main..50535
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2345: Argument of type 'Extract2<T, Foo, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'. | ||
| Type 'T extends Bar ? T : never' is not assignable to type '{ foo: string; bat: string; }'. | ||
| Type 'Bar & Foo & T' is not assignable to type '{ foo: string; bat: string; }'. | ||
| Property 'bat' is missing in type 'Bar & Foo' but required in type '{ foo: string; bat: string; }'. |
There was a problem hiding this comment.
This is really the only test that's affected? We don't have any other tests that try to intersect a type with {}?
There was a problem hiding this comment.
We have plenty of those, but what you're seeing here is the difference between normalizing all intersections in relationship checking vs. just normalizing intersections containing {}. Previously we didn't normalize intersections at all, relying instead on normalizing each individual constituent as we broke down the intersection in relationship checking. That worked when NonNullable<T> was a conditional type, but not with the new representation.
|
@typescript-bot cherry-pick this to release-4.8 |
|
Heya @RyanCavanaugh, I've started to run the task to cherry-pick this into |
|
Hey @RyanCavanaugh, I've opened #50549 for you. |
|
@typescript-bot test top100 |
|
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at 698c3ab. You can monitor the build here. Update: The results are in! |
|
@ahejlsberg Here are the results of running the top-repos suite comparing Everything looks good! |
|
Tests are all clean and perf looks good. This one is ready to merge. |
Fixes #50515.