-
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
Don't inferFromIndexTypes() twice #34501
Conversation
@typescript-bot user test this |
@typescript-bot user test this |
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. |
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. |
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
dea9d72
to
d045c4c
Compare
d37394a
to
82d6ad7
Compare
4765642
to
8af1dca
Compare
@jablko rather than the other changes in if (isArrayType(target)) {
inferFromIndexTypes(source, target);
return;
} from |
@weswigham Thanks a lot for taking a look at this! What you describe would call
|
1a56348
to
84baa5c
Compare
Hm, if that's the case, can we copy the tuple check into the |
✔️ Yup, that works. Done. |
09e96b8
to
6be718c
Compare
9c6fe7d
to
2cfb902
Compare
c248e7f
to
f85c83f
Compare
012cbda
to
3f15d40
Compare
@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. |
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.
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)
isnumber
whilef1(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)
is1
likef1(values)
FYI
f1(values)
is currently1
unlikef2(values)
because parameter and argument are the same generic type (tuple) and handled bywhereas
f2(values)
parameter (readonly tuple) and argument (tuple) aren't.