Skip to content

Commit f42605f

Browse files
TypeScript Botsandersn
andauthored
🤖 Pick PR #57746 (Revert "Defer processing of nested ...) into release-5.4 (#57752)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
1 parent 485c7c5 commit f42605f

File tree

4 files changed

+3
-170
lines changed

4 files changed

+3
-170
lines changed

‎src/compiler/checker.ts

Lines changed: 3 additions & 7 deletions
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

Lines changed: 0 additions & 72 deletions
This file was deleted.

‎tests/baselines/reference/inferenceGenericNestedCallReturningConstructor.types

Lines changed: 0 additions & 63 deletions
This file was deleted.

‎tests/cases/compiler/inferenceGenericNestedCallReturningConstructor.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy