Uh oh!
There was an error while loading. Please reload this page.
Improve logic that chooses co- vs. contra-variant inferences - #52123
Conversation
Jake Bailey (jakebailey)
commented
Jan 6, 2023
TypeScript Bot (@typescript-bot) test this |
Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at 26902df. You can monitor the build here. |
Heya Jake Bailey (@jakebailey), I've started to run the parallelized Definitely Typed test suite on this PR at 26902df. You can monitor the build here. |
Heya Jake Bailey (@jakebailey), I've started to run the extended test suite on this PR at 26902df. You can monitor the build here. |
Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at 26902df. You can monitor the build here. Update: The results are in! |
Heya Jake Bailey (@jakebailey), I've started to run the perf test suite on this PR at 26902df. You can monitor the build here. Update: The results are in! |
Heya Jake Bailey (@jakebailey), I've started to run the diff-based top-repos suite on this PR at 26902df. You can monitor the build here. Update: The results are in! |
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Jake Bailey (jakebailey)
commented
Jan 6, 2023
I can confirm that this fixes all of my cast/assert issues on the SFT branch. Wonderful! |
TypeScript Bot (typescript-bot)
commented
Jan 6, 2023
Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing Everything looks good! |
TypeScript Bot (typescript-bot)
commented
Jan 6, 2023
Heya Jake Bailey (@jakebailey), I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
TypeScript Bot (typescript-bot)
commented
Jan 6, 2023
Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing Everything looks good! |
TypeScript Bot (typescript-bot)
commented
Jan 6, 2023
Jake Bailey (@jakebailey) Here they are:CompilerComparison Report - main..52123
System
Hosts
Scenarios
TSServerComparison Report - main..52123
System
Hosts
Scenarios
StartupComparison Report - main..52123
System
Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jake Bailey (jakebailey)
commented
Jan 9, 2023
Another example that I didn't realize was affected is this: interfaceA{a: string;}interfaceBextendsA{b: string;}interfaceCextendsA{c: string}Then: declarefunctionisC(x: A): x is C;declarefunctionevery<T,UextendsT>(array: readonlyT[],callback: (element: T,index: number)=>element is U): array is readonlyU[];declarefunctionevery<T,UextendsT>(array: readonlyT[]|undefined,callback: (element: T,index: number)=>element is U): array is readonlyU[]|undefined;declarefunctionevery<T>(array: readonlyT[]|undefined,callback: (element: T,index: number)=>boolean): boolean;functionfoo(arr: readonlyB[]|readonlyC[]|undefined){if(every(arr,isC)){arr;}}In TS 4.9, this code errors because it picks (I may send a PR for this test case too.) |
Jake Bailey (jakebailey)
commented
Jan 10, 2023
I have another followup case that turned out to not be fixed (I also didn't catch it in the SFT branch in the same way as the above fixed case); I'll file a new issue. |
Fixes#52111.