mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Never-reducing intersections are not untyped function call targets (#42917)
* Never-reducing intersections are not untyped function call targets * Don’t attempt to reduce union types
This commit is contained in:
1 parent
8d58c8d90b
commit
56cf2e68e8
6 files changed
+42
-1
No files matched your search
@@ -28474,7 +28474,7 @@ namespace ts {
|
||||
function isUntypedFunctionCall(funcType: Type, apparentFuncType: Type, numCallSignatures: number, numConstructSignatures: number): boolean {
|
||||
// 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 && !(apparentFuncType.flags & (TypeFlags.Union | TypeFlags.Never)) && isTypeAssignableTo(funcType, globalFunctionType);
|
||||
!numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & TypeFlags.Union) && !(getReducedType(apparentFuncType).flags & TypeFlags.Never) && isTypeAssignableTo(funcType, globalFunctionType);
|
||||
}
|
||||
|
||||
function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[] | undefined, checkMode: CheckMode): Signature {
|
||||
|
||||
Reference in new issue
Block a user