- Notifications
You must be signed in to change notification settings - Fork13.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jablko commentedOct 15, 2019
@typescript-bot user test this |
RyanCavanaugh commentedOct 15, 2019
@typescript-bot user test this |
typescript-bot commentedOct 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 ate427f3f. You can monitor the buildhere. It should now contribute to this PR's status checks. |
typescript-bot commentedOct 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 ate427f3f. You can monitor the buildhere. It should now contribute to this PR's status checks. |
typescript-bot commentedOct 15, 2019
The user suite test run you requested has finished andfailed. I've opened aPR with the baseline diff from master. |
dea9d72 tod045c4cCompared37394a to82d6ad7Compare4765642 to8af1dcaCompareweswigham commentedNov 26, 2019
@jablko rather than the other changes in if(isArrayType(target)){inferFromIndexTypes(source,target);return;} from |
jablko commentedNov 26, 2019
@weswigham Thanks a lot for taking a look at this! What you describe would call
|
1a56348 to84baa5cCompareweswigham commentedNov 27, 2019
Hm, if that's the case, can we copy the tuple check into the |
jablko commentedNov 27, 2019
✔️ Yup, that works. Done. |
09e96b8 to6be718cCompare9c6fe7d to2cfb902Comparec248e7f tof85c83fCompare012cbda to3f15d40Comparesandersn commentedMar 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!
Uh oh!
There was an error while loading.Please reload this page.
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.