Merge pull request #20404 from Microsoft/fixUntypedFunctionCall

Fix untyped function call on constrained type variable
This commit is contained in:
Anders Hejlsberg authored and GitHub committed 2017-12-01 17:19:32 -08:00
commit f6b1a1de59
6 files changed
+219 -1

No files matched your search

+1 -1
View File
@@ -17115,7 +17115,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 {