If the contextual signature has fewer parameters than the function expression, do not use it
(signature, target)
| 73268 | } |
| 73269 | /** If the contextual signature has fewer parameters than the function expression, do not use it */ |
| 73270 | function isAritySmaller(signature, target) { |
| 73271 | var targetParameterCount = 0; |
| 73272 | for (; targetParameterCount < target.parameters.length; targetParameterCount++) { |
| 73273 | var param = target.parameters[targetParameterCount]; |
| 73274 | if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { |
| 73275 | break; |
| 73276 | } |
| 73277 | } |
| 73278 | if (target.parameters.length && ts.parameterIsThisKeyword(target.parameters[0])) { |
| 73279 | targetParameterCount--; |
| 73280 | } |
| 73281 | return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; |
| 73282 | } |
| 73283 | function getContextualSignatureForFunctionLikeDeclaration(node) { |
| 73284 | // Only function expressions, arrow functions, and object literal methods are contextually typed. |
| 73285 | return ts.isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) |
no test coverage detected