Uh oh!
There was an error while loading. Please reload this page.
Fix conditional type type parameter leak - #31455
Conversation
Nathan Shively-Sanders (sandersn)
left a comment
There was a problem hiding this comment.
Some high-level questions.
Uh oh!
There was an error while loading. Please reload this page.
| const freshParams = map(root.inferTypeParameters, cloneTypeParameter); | ||
| const freshMapper = createTypeMapper(root.inferTypeParameters, freshParams); | ||
| const context = createInferenceContext(freshParams, /*signature*/ undefined, InferenceFlags.None); | ||
| // We have three mappers that need applying: |
There was a problem hiding this comment.
is there a more concise way to write this whole block? This right here is "here be dragons" commenting level Double Dragon. I expect demons to fly out of my nose after reading it.
| // * Clone the type parameters so their constraints can be instantiated in the context of `mapper` | ||
| // * Set the clones to both map the context and the original params | ||
| // * instantiate the extends type with the clones | ||
| // * incorporate all of the component mappers into the combined mapper for the members |
There was a problem hiding this comment.
oh no it happened
👃
👿
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Wesley Wigham (weswigham)
commented
May 20, 2019
Nathan Shively-Sanders (@sandersn) comment order and informational content altered~ |
| // * The original `mapper` used to create this conditional | ||
| // * The mapper that maps the old root type parameter to the clone (`freshMapper`) | ||
| // * The mapper that maps the clone to its inference result (`context.mapper`) | ||
| const freshParams = map(root.inferTypeParameters, cloneTypeParameter); |
There was a problem hiding this comment.
I'm concerned about all the new type identities created by always cloning the type parameters here. Fresh type parameters mean more work and more bloat in relationship caches. I'm wondering if we can somehow realize that we don't need to clone as that clearly covers the vast majority of cases.
There was a problem hiding this comment.
We could avoid clone type parameters which aren't constrained to an instantiable type, for what that'd give us.
Wesley Wigham (weswigham)
commented
May 23, 2019
TypeScript Bot (@typescript-bot) run dt |
Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 9133ec5. You can monitor the build here. It should now contribute to this PR's status checks. Update: The results are in! |
Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 9133ec5. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 9133ec5. You can monitor the build here. It should now contribute to this PR's status checks. |
TypeScript Bot (typescript-bot)
commented
May 23, 2019
Wesley Wigham (@weswigham) Here they are:Comparison Report - master..31455
System
Hosts
Scenarios
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wesley Wigham (weswigham)
commented
May 23, 2019
RWC failed because there was a small diff in |
Uh oh!
There was an error while loading. Please reload this page.
Wesley Wigham (weswigham)
commented
Sep 24, 2019
TypeScript Bot (@typescript-bot) test this |
Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 6c86917. You can monitor the build here. It should now contribute to this PR's status checks. Update: The results are in! |
Heya Wesley Wigham (@weswigham), I've started to run the parallelized community code test suite on this PR at 6c86917. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 6c86917. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 6c86917. You can monitor the build here. It should now contribute to this PR's status checks. |
TypeScript Bot (typescript-bot)
commented
Sep 24, 2019
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
TypeScript Bot (typescript-bot)
commented
Sep 24, 2019
Wesley Wigham (@weswigham) Here they are:Comparison Report - master..31455
System
Hosts
Scenarios
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wesley Wigham (weswigham)
commented
Feb 10, 2020
TypeScript Bot (@typescript-bot) test this |
Heya Wesley Wigham (@weswigham), I've started to run the parallelized community code test suite on this PR at 76ae07b. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 76ae07b. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 76ae07b. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 76ae07b. You can monitor the build here. It should now contribute to this PR's status checks. |
TypeScript Bot (typescript-bot)
commented
Feb 10, 2020
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
Wesley Wigham (weswigham)
commented
Feb 10, 2020
Anders Hejlsberg (@ahejlsberg) opted to reschedule this to 3.9 in person, but imma still need an updated review status at some point, thanks ❤️ |
Wesley Wigham (weswigham)
commented
Mar 9, 2022
Man, I missed this one for a long time because it never got an updated github review status, but since it got an offline approval, 4.7 is kinda like 3.9 I guess. Once CI is green, I'll merge this. |
Fixes#31402