-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply contextual type to empty array literals #47898
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: |
@@ -27093,6 +27096,12 @@ namespace ts { | |||
const elementTypes: Type[] = []; | |||
const elementFlags: ElementFlags[] = []; | |||
const contextualType = getApparentTypeOfContextualType(node); | |||
if (elementCount === 0 && contextualType && !checkMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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