Skip to content

Commit

Permalink
🤖 Pick PR #57746 (Revert "Defer processing of nested ...) into releas…
Browse files Browse the repository at this point in the history
…e-5.4 (#57752)

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
  • Loading branch information
typescript-bot and sandersn committed Mar 15, 2024
1 parent 485c7c5 commit f42605f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 170 deletions.
10 changes: 3 additions & 7 deletions src/compiler/checker.ts
Expand Up @@ -35136,7 +35136,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// use the resolvingSignature singleton to indicate that we deferred processing. This result will be
// propagated out and eventually turned into silentNeverType (a type that is assignable to anything and
// from which we never make inferences).
if (checkMode & CheckMode.SkipGenericFunctions && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
if (checkMode & CheckMode.SkipGenericFunctions && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
skippedGenericFunction(node, checkMode);
return resolvingSignature;
}
Expand All @@ -35149,12 +35149,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
}

function isGenericFunctionReturningFunctionOrConstructor(signature: Signature) {
if (!signature.typeParameters) {
return false;
}
const returnType = getReturnTypeOfSignature(signature);
return isFunctionType(returnType) || isConstructorType(returnType);
function isGenericFunctionReturningFunction(signature: Signature) {
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
}

/**
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f42605f

Please sign in to comment.