@@ -10322,7 +10322,7 @@ namespace ts {
10322
10322
}
10323
10323
10324
10324
function hasCorrectArity(node: CallLikeExpression, args: Expression[], signature: Signature) {
10325
- let adjustedArgCount : number; // Apparent number of arguments we will have in this call
10325
+ let argCount : number; // Apparent number of arguments we will have in this call
10326
10326
let typeArguments: NodeArray<TypeNode>; // Type arguments (undefined if none)
10327
10327
let callIsIncomplete: boolean; // In incomplete call we want to be lenient when we have too few arguments
10328
10328
let isDecorator: boolean;
@@ -10333,7 +10333,7 @@ namespace ts {
10333
10333
10334
10334
// Even if the call is incomplete, we'll have a missing expression as our last argument,
10335
10335
// so we can say the count is just the arg list length
10336
- adjustedArgCount = args.length;
10336
+ argCount = args.length;
10337
10337
typeArguments = undefined;
10338
10338
10339
10339
if (tagExpression.template.kind === SyntaxKind.TemplateExpression) {
@@ -10356,7 +10356,7 @@ namespace ts {
10356
10356
else if (node.kind === SyntaxKind.Decorator) {
10357
10357
isDecorator = true;
10358
10358
typeArguments = undefined;
10359
- adjustedArgCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature);
10359
+ argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature);
10360
10360
}
10361
10361
else {
10362
10362
const callExpression = <CallExpression>node;
@@ -10367,8 +10367,7 @@ namespace ts {
10367
10367
return signature.minArgumentCount === 0;
10368
10368
}
10369
10369
10370
- //For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument.
10371
- adjustedArgCount = args.length; //callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length;
10370
+ argCount = args.length;
10372
10371
10373
10372
// If we are missing the close paren, the call is incomplete.
10374
10373
callIsIncomplete = (<CallExpression>callExpression).arguments.end === callExpression.end;
@@ -10392,12 +10391,12 @@ namespace ts {
10392
10391
}
10393
10392
10394
10393
// Too many arguments implies incorrect arity.
10395
- if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) {
10394
+ if (!signature.hasRestParameter && argCount > signature.parameters.length) {
10396
10395
return false;
10397
10396
}
10398
10397
10399
10398
// If the call is incomplete, we should skip the lower bound check.
10400
- const hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount;
10399
+ const hasEnoughArguments = argCount >= signature.minArgumentCount;
10401
10400
return callIsIncomplete || hasEnoughArguments;
10402
10401
}
10403
10402
0 commit comments