-
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 a contextual type to empty arrays #51882
Conversation
@typescript-bot test this |
Heya @RyanCavanaugh, I've started to run the diff-based user code test suite on this PR at eed0acb. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the diff-based user code test suite (tsserver) on this PR at eed0acb. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at eed0acb. You can monitor the build here. |
Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite (tsserver) on this PR at eed0acb. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the perf test suite on this PR at eed0acb. You can monitor the build here. |
Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite on this PR at eed0acb. You can monitor the build here. Update: The results are in! |
Heya @RyanCavanaugh, I've started to run the parallelized Definitely Typed test suite on this PR at eed0acb. You can monitor the build here. |
@typescript-bot pack this |
Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at eed0acb. You can monitor the build here. |
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 are the results of running the user test suite comparing Everything looks good! |
1 similar comment
@RyanCavanaugh Here are the results of running the user test suite comparing Everything looks good! |
Heya @RyanCavanaugh, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
@RyanCavanaugh Here are the results of running the top-repos suite comparing Everything looks good! |
@RyanCavanaugh Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Detailsfelixrieseberg/windows95
|
>isCustom : Symbol(MyCustomArray.isCustom, Decl(arrayContextualTyping.ts, 1, 51)) | ||
} |
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.
@RyanCavanaugh Could you please clarify what is the purpose of this isCustom
property? Looking at this, it seems to me like it is a condition to run a different set of tests, if so it does not seem like a good practice to have conditional tests.
Some design notes at #51853 (comment)
We'll need to discuss this test in particular: https://github.com/microsoft/TypeScript/compare/main...RyanCavanaugh:ctEmptyArrayRetry?expand=1#diff-143cc97a4709c639aa96ddd0c9cac92f3b8a11b104eb5611e0b83c145fdb571a ; I believe the contextual type providing logic is effectively wrong in this case and will try to make a demonstration of such.
Fixes #51853