From 5465a5aa72c68ab4a680a9001b42d109d19955cf Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 1 Dec 2017 16:48:29 -0800 Subject: [PATCH] Check apparent type instead of function type in isUntypedFunctionCall --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0b8ba29a710..849dec8eaad 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17109,7 +17109,7 @@ namespace ts { function isUntypedFunctionCall(funcType: Type, apparentFuncType: Type, numCallSignatures: number, numConstructSignatures: number) { // We exclude union types because we may have a union of function types that happen to have no common signatures. return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & TypeFlags.TypeParameter || - !numCallSignatures && !numConstructSignatures && !(funcType.flags & (TypeFlags.Union | TypeFlags.Never)) && isTypeAssignableTo(funcType, globalFunctionType); + !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (TypeFlags.Union | TypeFlags.Never)) && isTypeAssignableTo(funcType, globalFunctionType); } function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[]): Signature {