Fixed an issue with constraint of an infer type parameter not being fully instantiatable#54205
Fixed an issue with constraint of an infer type parameter not being fully instantiatable#54205Andarist wants to merge 2 commits intomicrosoft:mainfrom
Conversation
…ully instantiatable
| function maybeCloneTypeParameter(p: TypeParameter) { | ||
| const constraint = getConstraintOfTypeParameter(p); | ||
| return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p; | ||
| return constraint && couldContainTypeVariables(constraint) ? cloneTypeParameter(p) : p; |
There was a problem hiding this comment.
I keep thinking that perhaps there is a better check for this kind of thing - but I honestly don't know what it is. I already had a need for this a couple of times and I couldn't find anything else in the codebase that would already test this kind of stuff in a different way.
There was a problem hiding this comment.
This function was introduced back in #31455; I suspect that it was a targeted fix and personally I'm partial to what you're changing it to (it makes sense to me as an optimization; if we always called clone, all tests pass, it's just slower).
|
@typescript-bot test this |
|
Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 0519dfa. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 0519dfa. You can monitor the build here. |
|
Heya @jakebailey, I've started to run the abridged perf test suite on this PR at 0519dfa. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 0519dfa. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the tarball bundle task on this PR at 0519dfa. You can monitor the build here. |
|
Heya @jakebailey, I've started to run the extended test suite on this PR at 0519dfa. You can monitor the build here. |
|
Hey @jakebailey, 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 |
|
@jakebailey Here they are:Comparison Report - main..54205
System
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
|
Hey @jakebailey, the results of running the DT tests are ready. |
…ending-on-type-variables
fixes #54197