(node, candidatesOutArray, checkMode)
| 76427 | return maxParamsIndex; |
| 76428 | } |
| 76429 | function resolveCallExpression(node, candidatesOutArray, checkMode) { |
| 76430 | if (node.expression.kind === 106 /* SyntaxKind.SuperKeyword */) { |
| 76431 | var superType = checkSuperExpression(node.expression); |
| 76432 | if (isTypeAny(superType)) { |
| 76433 | for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { |
| 76434 | var arg = _a[_i]; |
| 76435 | checkExpression(arg); // Still visit arguments so they get marked for visibility, etc |
| 76436 | } |
| 76437 | return anySignature; |
| 76438 | } |
| 76439 | if (!isErrorType(superType)) { |
| 76440 | // In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated |
| 76441 | // with the type arguments specified in the extends clause. |
| 76442 | var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node)); |
| 76443 | if (baseTypeNode) { |
| 76444 | var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); |
| 76445 | return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, 0 /* SignatureFlags.None */); |
| 76446 | } |
| 76447 | } |
| 76448 | return resolveUntypedCall(node); |
| 76449 | } |
| 76450 | var callChainFlags; |
| 76451 | var funcType = checkExpression(node.expression); |
| 76452 | if (ts.isCallChain(node)) { |
| 76453 | var nonOptionalType = getOptionalExpressionType(funcType, node.expression); |
| 76454 | callChainFlags = nonOptionalType === funcType ? 0 /* SignatureFlags.None */ : |
| 76455 | ts.isOutermostOptionalChain(node) ? 16 /* SignatureFlags.IsOuterCallChain */ : |
| 76456 | 8 /* SignatureFlags.IsInnerCallChain */; |
| 76457 | funcType = nonOptionalType; |
| 76458 | } |
| 76459 | else { |
| 76460 | callChainFlags = 0 /* SignatureFlags.None */; |
| 76461 | } |
| 76462 | funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError); |
| 76463 | if (funcType === silentNeverType) { |
| 76464 | return silentNeverSignature; |
| 76465 | } |
| 76466 | var apparentType = getApparentType(funcType); |
| 76467 | if (isErrorType(apparentType)) { |
| 76468 | // Another error has already been reported |
| 76469 | return resolveErrorCall(node); |
| 76470 | } |
| 76471 | // Technically, this signatures list may be incomplete. We are taking the apparent type, |
| 76472 | // but we are not including call signatures that may have been added to the Object or |
| 76473 | // Function interface, since they have none by default. This is a bit of a leap of faith |
| 76474 | // that the user will not add any. |
| 76475 | var callSignatures = getSignaturesOfType(apparentType, 0 /* SignatureKind.Call */); |
| 76476 | var numConstructSignatures = getSignaturesOfType(apparentType, 1 /* SignatureKind.Construct */).length; |
| 76477 | // TS 1.0 Spec: 4.12 |
| 76478 | // In an untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual |
| 76479 | // types are provided for the argument expressions, and the result is always of type Any. |
| 76480 | if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { |
| 76481 | // The unknownType indicates that an error already occurred (and was reported). No |
| 76482 | // need to report another error in this case. |
| 76483 | if (!isErrorType(funcType) && node.typeArguments) { |
| 76484 | error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); |
| 76485 | } |
| 76486 | return resolveUntypedCall(node); |
no test coverage detected
searching dependent graphs…