Apply contextual type to empty array literals#47898
Apply contextual type to empty array literals#47898RyanCavanaugh wants to merge 3 commits intomicrosoft:mainfrom
Conversation
|
@typescript-bot test this |
|
Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at 62c8ae1. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the parallelized community code test suite on this PR at 62c8ae1. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at 62c8ae1. You can monitor the build here. |
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
|
@typescript-bot test this |
|
Heya @RyanCavanaugh, I've started to run the parallelized community code test suite on this PR at 6c8f308. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at 6c8f308. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at 6c8f308. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the perf test suite on this PR at 6c8f308. You can monitor the build here. Update: The results are in! |
|
Heya @RyanCavanaugh, I've started to run the abridged perf test suite on this PR at 6c8f308. You can monitor the build here. Update: The results are in! |
|
Hey @RyanCavanaugh, 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 |
|
@RyanCavanaugh Here they are:Comparison Report - main..47898
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@RyanCavanaugh Here they are:Comparison Report - main..47898
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const elementTypes: Type[] = []; | ||
| const elementFlags: ElementFlags[] = []; | ||
| const contextualType = getApparentTypeOfContextualType(node); | ||
| if (elementCount === 0 && contextualType && !checkMode) { |
There was a problem hiding this comment.
I think this may need to be moved lower, right below the tuple check - otherwise you'll never be able to get an empty tuple inferred via a contextual type.
Just an experiment