mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Revert "Defer processing of nested generic calls that return construc… (#57746)
This commit is contained in:
committed by
GitHub
parent
3e91592b06
commit
e66049084b
@@ -35187,7 +35187,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;
|
||||
}
|
||||
@@ -35200,12 +35200,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)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user