- Notifications
You must be signed in to change notification settings - Fork 13.2k
Don't inferFromIndexTypes() twice#34501
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
Conversation
jablko commented Oct 15, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
jablko commented Oct 15, 2019
@typescript-bot user test this |
RyanCavanaugh commented Oct 15, 2019
@typescript-bot user test this |
typescript-bot commented Oct 15, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @RyanCavanaugh, I've started to run the parallelized community code test suite on this PR at e427f3f. You can monitor the build here. It should now contribute to this PR's status checks. |
typescript-bot commented Oct 15, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at e427f3f. You can monitor the build here. It should now contribute to this PR's status checks. |
typescript-bot commented Oct 15, 2019
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
dea9d72 to d045c4cCompared37394a to 82d6ad7Compare4765642 to 8af1dcaCompareweswigham commented Nov 26, 2019
@jablko rather than the other changes in if(isArrayType(target)){inferFromIndexTypes(source,target);return;}from |
jablko commented Nov 26, 2019
@weswigham Thanks a lot for taking a look at this! What you describe would call
|
1a56348 to 84baa5cCompareweswigham commented Nov 27, 2019
Hm, if that's the case, can we copy the tuple check into the |
jablko commented Nov 27, 2019
✔️ Yup, that works. Done. |
09e96b8 to 6be718cCompare9c6fe7d to 2cfb902Comparec248e7f to f85c83fCompare012cbda to 3f15d40Comparesandersn commented Mar 4, 2020
@weswigham are you happy with this change now? It's been a while, but the inference code hasn't changed much in the last few months. |
weswigham left a comment • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah, I think this is fine now (it just moves a chunk of code out of a call and into the (only) caller), I just wanted @ahejlsberg to look at it briefly before it got in, which is why he's assigned iirc.
StefanXhunga left a comment
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.
Thank you for your assistance, please change the nesessery scedares!
Fixes#33559
Fixes#33752
Fixes
#34924Fixes#34925
Fixes#34937
Fixes
#35136Fixes
#35258Currently
f2(values)isnumberwhilef1(values)is1.There are three cases in
inferFromProperties()inferFromIndexTypes()But then
inferFromObjectTypesWorker()callsinferFromIndexTypes()again, in all casesThis PR moves that call from
inferFromObjectTypesWorker()to the third case. ConsequentlyinferFromIndexTypes()isn't called twice in the second (array) casef2(values)is1likef1(values)FYI
f1(values)is currently1unlikef2(values)because parameter and argument are the same generic type (tuple) and handled bywhereas
f2(values)parameter (readonly tuple) and argument (tuple) aren't.