Repository navigation
Don't eagerly simplify reducible generic union index types - #46812
Conversation
|
TypeScript Bot (@typescript-bot) perf test this |
|
Heya Andrew Branch (@andrewbranch), I've started to run the perf test suite on this PR at 43bfe00. You can monitor the build here. Update: The results are in! |
|
Heya Andrew Branch (@andrewbranch), I've started to run the inline community code test suite on this PR at 43bfe00. You can monitor the build here. Update: The results are in! |
|
Heya Andrew Branch (@andrewbranch), I've started to run the parallelized Definitely Typed test suite on this PR at 43bfe00. You can monitor the build here. |
|
Andrew Branch (@andrewbranch) |
|
Andrew Branch (@andrewbranch) Here they are:Comparison Report - main..46812
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
All the extended CI results and perf look fine. Reviews please~ |
|
Wesley Wigham (@weswigham) Is this ready? Does it need another review? I just noticed it when going through the Needs Merge column of the PR backlog. |
Fixes #45530
The issue wasn't that the mapped types were losing information, per sey, in fact, they were responsible for rehydrating missing information in some instances - instead, the issue was that we were too eagerly reducing the
keyofresult of unions over types which might have been reduced upon instantiation, like({v: T} & {v: "a", a: string}) | ({v: T} & {v: "b", b: string}). Before this change,keyofthat was just"v", while now it will remain the generickeyof (({v: T} & {v: "a", a: string}) | ({v: T} & {v: "b", b: string})), since instantiation can make it simplify to eitherkeyof ({v: "a"} & {v: "a", a: string})orkeyof ({v: "b"} & {v: "b", b: string}), which have keys"v" | "a"or"v" | "b", respectively. (Which in turn trickles down to assignability behavior of mapped types over those kinds ofkeyoftypes)