Skip to content

Commit f42605f

Browse files
TypeScript Botsandersn
TypeScript Bot
andauthored
🤖 Pick PR #57746 (Revert "Defer processing of nested ...) into release-5.4 (#57752)
Co-authored-by: Nathan Shively-Sanders <[email protected]>
1 parent 485c7c5 commit f42605f

4 files changed

+3
-170
lines changed

‎src/compiler/checker.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -35136,7 +35136,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3513635136
// use the resolvingSignature singleton to indicate that we deferred processing. This result will be
3513735137
// propagated out and eventually turned into silentNeverType (a type that is assignable to anything and
3513835138
// from which we never make inferences).
35139-
if (checkMode & CheckMode.SkipGenericFunctions && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
35139+
if (checkMode & CheckMode.SkipGenericFunctions && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
3514035140
skippedGenericFunction(node, checkMode);
3514135141
return resolvingSignature;
3514235142
}
@@ -35149,12 +35149,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3514935149
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
3515035150
}
3515135151

35152-
function isGenericFunctionReturningFunctionOrConstructor(signature: Signature) {
35153-
if (!signature.typeParameters) {
35154-
return false;
35155-
}
35156-
const returnType = getReturnTypeOfSignature(signature);
35157-
return isFunctionType(returnType) || isConstructorType(returnType);
35152+
function isGenericFunctionReturningFunction(signature: Signature) {
35153+
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
3515835154
}
3515935155

3516035156
/**

‎tests/baselines/reference/inferenceGenericNestedCallReturningConstructor.symbols

-72
This file was deleted.

‎tests/baselines/reference/inferenceGenericNestedCallReturningConstructor.types

-63
This file was deleted.

‎tests/cases/compiler/inferenceGenericNestedCallReturningConstructor.ts

-28
This file was deleted.

0 commit comments

Comments
 (0)