Defer distributing index over generic object types#50540
Conversation
|
@typescript-bot test this |
|
Heya @DanielRosenwasser, I've started to run the diff-based user code test suite on this PR at 00e3926. You can monitor the build here. Update: The results are in! |
|
Heya @DanielRosenwasser, I've started to run the extended test suite on this PR at 00e3926. You can monitor the build here. |
|
Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at 00e3926. You can monitor the build here. Update: The results are in! |
|
Heya @DanielRosenwasser, I've started to run the parallelized Definitely Typed test suite on this PR at 00e3926. You can monitor the build here. |
|
@DanielRosenwasser Here are the results of running the user test suite comparing Everything looks good! |
|
Heya @DanielRosenwasser, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
|
@DanielRosenwasser Here they are:
CompilerComparison Report - main..50540
System
Hosts
Scenarios
TSServerComparison Report - main..50540
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@typescript-bot test top100 |
|
Heya @DanielRosenwasser, I've started to run the diff-based user code test suite on this PR at 00e3926. You can monitor the build here. |
|
@DanielRosenwasser @sandersn Looks like the top100 test is bombing out in one of the processes. Same issue over in #50535. |
ahejlsberg
left a comment
There was a problem hiding this comment.
This change makes sense, but I'd prefer reducing the scope a bit as suggested here.
| if (shouldDeferIndexType(objectType)) { | ||
| return; | ||
| } |
| } | ||
| // (T | U)[K] -> T[K] | U[K] (reading) | ||
| // (T | U)[K] -> T[K] & U[K] (writing) | ||
| // (T & U)[K] -> T[K] & U[K] |
There was a problem hiding this comment.
Change the following line to:
if (objectType.flags & TypeFlags.Union || objectType.Flags & TypeFlags.Intersection && !shouldDeferIndexType(objectType)) ...There was a problem hiding this comment.
I'm concerned that shouldDeferIndexType will also do (possibly expensive) work for union types, so I'd prefer only deferring for intersection types.
|
@ahejlsberg I've applied the suggested change and rerun the test suite locally - everything looks OK on this front, somebody from the TS team has to start new perf tests though. |
|
@typescript-bot perf test this my liege |
Fixes #50539
cc @ahejlsberg , the
shouldDeferIndexTypecheck has been introduced based on the changes in this PR: https://github.com/microsoft/TypeScript/pull/49696/files