From e9737b893c75997d52859dc1d4b348892387ec4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 30 Nov 2023 00:06:42 +0100 Subject: [PATCH] Report arity errors on call target nodes (#54443) Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> --- src/compiler/checker.ts | 18 ++---------- ...yErrorRelatedSpanBindingPattern.errors.txt | 4 +-- .../baselines/reference/baseCheck.errors.txt | 2 +- ...dSameNameFunctionDeclarationES5.errors.txt | 2 +- ...dSameNameFunctionDeclarationES6.errors.txt | 2 +- ...ameFunctionDeclarationStrictES5.errors.txt | 4 +-- ...ameFunctionDeclarationStrictES6.errors.txt | 4 +-- .../reference/callOverload.errors.txt | 2 +- .../reference/callWithMissingVoid.errors.txt | 22 +++++++-------- ...nedUnknownAnyInJs(strict=false).errors.txt | 12 ++++---- ...inedUnknownAnyInJs(strict=true).errors.txt | 24 ++++++++-------- ...assCanExtendConstructorFunction.errors.txt | 2 +- ...llingBaseImplWithOptionalParams.errors.txt | 2 +- .../reference/es5DateAPIs.errors.txt | 2 +- .../reference/functionCall11.errors.txt | 2 +- .../reference/functionCall12.errors.txt | 2 +- .../reference/functionCall13.errors.txt | 2 +- .../reference/functionCall16.errors.txt | 2 +- .../reference/functionCall17.errors.txt | 2 +- .../reference/functionCall18.errors.txt | 2 +- .../reference/functionCall6.errors.txt | 2 +- .../reference/functionCall7.errors.txt | 2 +- .../reference/functionOverloads29.errors.txt | 2 +- .../reference/functionOverloads34.errors.txt | 2 +- .../reference/functionOverloads37.errors.txt | 2 +- .../functionParameterArityMismatch.errors.txt | 10 +++---- ...unctionsWithOptionalParameters2.errors.txt | 2 +- .../reference/genericRestArity.errors.txt | 2 +- .../genericRestArityStrict.errors.txt | 2 +- .../genericRestParameters3.errors.txt | 2 +- .../iterableArrayPattern25.errors.txt | 2 +- ...leFunctionParametersAsOptional2.errors.txt | 6 ++-- .../jsdocTypeTagRequiredParameters.errors.txt | 6 ++-- .../reference/methodChainError.errors.txt | 2 +- ...ortWithExportPropertyAssignment.errors.txt | 2 +- .../optionalParamArgsTest.errors.txt | 16 +++++------ .../baselines/reference/overload1.errors.txt | 2 +- ...loadsAndTypeArgumentArityErrors.errors.txt | 2 +- .../reference/privateNameMethod.errors.txt | 2 +- .../privateNameStaticMethod.errors.txt | 2 +- .../requiredInitializedParameter1.errors.txt | 4 +-- .../restParamsWithNonRestParams.errors.txt | 2 +- .../simpleRecursionWithBaseCase1.errors.txt | 4 +-- ...romGeneratorMakesRequiredParams.errors.txt | 2 +- .../reference/strictBindCallApply1.errors.txt | 6 ++-- .../templateLiteralsInTypes.errors.txt | 2 +- .../thisTypeInFunctionsNegative.errors.txt | 10 +++---- ...eAssertionToGenericFunctionType.errors.txt | 2 +- .../unionTypeCallSignatures.errors.txt | 28 +++++++++---------- .../unionTypeCallSignatures4.errors.txt | 2 +- .../reference/unionTypeReduction2.errors.txt | 2 +- .../reference/variadicTuples1.errors.txt | 2 +- .../fourslash/arityErrorAfterSignatureHelp.ts | 6 ++-- .../arityErrorAfterStringCompletions.ts | 6 ++-- 54 files changed, 125 insertions(+), 137 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 604c2835452..19783987995 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -33922,21 +33922,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - function getDiagnosticSpanForCallNode(node: CallExpression, doNotIncludeArguments?: boolean) { - let start: number; - let length: number; + function getDiagnosticSpanForCallNode(node: CallExpression) { const sourceFile = getSourceFileOfNode(node); - - if (isPropertyAccessExpression(node.expression)) { - const nameSpan = getErrorSpanForNode(sourceFile, node.expression.name); - start = nameSpan.start; - length = doNotIncludeArguments ? nameSpan.length : node.end - start; - } - else { - const expressionSpan = getErrorSpanForNode(sourceFile, node.expression); - start = expressionSpan.start; - length = doNotIncludeArguments ? expressionSpan.length : node.end - start; - } + const { start, length } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression); return { start, length, sourceFile }; } @@ -34915,7 +34903,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); } if (isCallExpression(errorTarget.parent)) { - const { start, length } = getDiagnosticSpanForCallNode(errorTarget.parent, /*doNotIncludeArguments*/ true); + const { start, length } = getDiagnosticSpanForCallNode(errorTarget.parent); diagnostic.start = start; diagnostic.length = length; } diff --git a/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt b/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt index 008c8d2e399..ad14784e6e3 100644 --- a/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt +++ b/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.errors.txt @@ -8,12 +8,12 @@ arityErrorRelatedSpanBindingPattern.ts(7,1): error TS2554: Expected 3 arguments, function bar(a, b, [c]): void {} foo("", 0); - ~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6211 arityErrorRelatedSpanBindingPattern.ts:1:20: An argument matching this binding pattern was not provided. bar("", 0); - ~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6211 arityErrorRelatedSpanBindingPattern.ts:3:20: An argument matching this binding pattern was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index e3da66d472f..58464d7fb99 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -30,7 +30,7 @@ baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. } class D extends C { constructor(public z: number) { super(this.z) } } // too few params - ~~~~~~~~~~~~~ + ~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 baseCheck.ts:1:34: An argument for 'y' was not provided. ~~~~ diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt index 520ce2bb735..47b4cf9a063 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.errors.txt @@ -33,6 +33,6 @@ blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arg } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 blockScopedSameNameFunctionDeclarationES5.ts:1:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt index 45ccd8b400b..19f6f09e639 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt @@ -33,6 +33,6 @@ blockScopedSameNameFunctionDeclarationES6.ts(16,1): error TS2554: Expected 1 arg } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 blockScopedSameNameFunctionDeclarationES6.ts:1:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt index b510cc0b9b4..86d4d724cac 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES5.errors.txt @@ -29,12 +29,12 @@ blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): error TS2554: Expected } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 blockScopedSameNameFunctionDeclarationStrictES5.ts:2:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 blockScopedSameNameFunctionDeclarationStrictES5.ts:2:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt index 4086b95bd59..0863524100f 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationStrictES6.errors.txt @@ -23,12 +23,12 @@ blockScopedSameNameFunctionDeclarationStrictES6.ts(17,1): error TS2554: Expected } foo(10); foo(); // not ok - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 blockScopedSameNameFunctionDeclarationStrictES6.ts:2:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 blockScopedSameNameFunctionDeclarationStrictES6.ts:2:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/callOverload.errors.txt b/tests/baselines/reference/callOverload.errors.txt index f19a0b8af45..e10608b023b 100644 --- a/tests/baselines/reference/callOverload.errors.txt +++ b/tests/baselines/reference/callOverload.errors.txt @@ -19,7 +19,7 @@ callOverload.ts(11,10): error TS2556: A spread argument must either have a tuple !!! error TS2554: Expected 2 arguments, but got 4. withRest('a', ...n); // no error withRest(); - ~~~~~~~~~~ + ~~~~~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 callOverload.ts:3:27: An argument for 'a' was not provided. withRest(...n); diff --git a/tests/baselines/reference/callWithMissingVoid.errors.txt b/tests/baselines/reference/callWithMissingVoid.errors.txt index 7de86855ba2..27c4b8daefb 100644 --- a/tests/baselines/reference/callWithMissingVoid.errors.txt +++ b/tests/baselines/reference/callWithMissingVoid.errors.txt @@ -28,19 +28,19 @@ callWithMissingVoid.ts(75,1): error TS2554: Expected 3 arguments, but got 1. declare const xAny: X; xAny.f() // error, any still expects an argument - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 callWithMissingVoid.ts:3:7: An argument for 't' was not provided. declare const xUnknown: X; xUnknown.f() // error, unknown still expects an argument - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 callWithMissingVoid.ts:3:7: An argument for 't' was not provided. declare const xNever: X; xNever.f() // error, never still expects an argument - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 callWithMissingVoid.ts:3:7: An argument for 't' was not provided. @@ -56,15 +56,15 @@ callWithMissingVoid.ts(75,1): error TS2554: Expected 3 arguments, but got 1. new MyPromise(resolve => resolve()); // no error new MyPromise(resolve => resolve()); // no error new MyPromise(resolve => resolve()); // error, `any` arguments cannot be omitted - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 callWithMissingVoid.ts:28:38: An argument for 'value' was not provided. new MyPromise(resolve => resolve()); // error, `unknown` arguments cannot be omitted - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 callWithMissingVoid.ts:28:38: An argument for 'value' was not provided. new MyPromise(resolve => resolve()); // error, `never` arguments cannot be omitted - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 callWithMissingVoid.ts:28:38: An argument for 'value' was not provided. @@ -78,7 +78,7 @@ callWithMissingVoid.ts(75,1): error TS2554: Expected 3 arguments, but got 1. a(4, "hello"); // ok a(4, "hello", void 0); // ok a(4); // not ok - ~~~~ + ~ !!! error TS2554: Expected 2-3 arguments, but got 1. !!! related TS6210 callWithMissingVoid.ts:42:23: An argument for 'y' was not provided. @@ -88,15 +88,15 @@ callWithMissingVoid.ts(75,1): error TS2554: Expected 3 arguments, but got 1. b(4, "hello", void 0, 2); // ok b(4, "hello"); // not ok - ~~~~~~~~~~~~~ + ~ !!! error TS2554: Expected 4 arguments, but got 2. !!! related TS6210 callWithMissingVoid.ts:50:34: An argument for 'z' was not provided. b(4, "hello", void 0); // not ok - ~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS2554: Expected 4 arguments, but got 3. !!! related TS6210 callWithMissingVoid.ts:50:43: An argument for 'what' was not provided. b(4); // not ok - ~~~~ + ~ !!! error TS2554: Expected 4 arguments, but got 1. !!! related TS6210 callWithMissingVoid.ts:50:23: An argument for 'y' was not provided. @@ -117,7 +117,7 @@ callWithMissingVoid.ts(75,1): error TS2554: Expected 3 arguments, but got 1. ...args: TS): void; call((x: number, y: number) => x + y) // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6236 callWithMissingVoid.ts:73:5: Arguments for the rest parameter 'args' were not provided. call((x: number, y: number) => x + y, 4, 2) // ok diff --git a/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=false).errors.txt b/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=false).errors.txt index 1e07ccaa1a3..eda6d969332 100644 --- a/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=false).errors.txt +++ b/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=false).errors.txt @@ -39,28 +39,28 @@ tsfile.ts(12,4): error TS2554: Expected 1 arguments, but got 0. // no change in behavior f2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:2:21: An argument for 'p' was not provided. f3(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:3:21: An argument for 'p' was not provided. f4(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:4:21: An argument for 'p' was not provided. o2.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. o3.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. o4.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=true).errors.txt b/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=true).errors.txt index 560b38ad42c..4323dce5667 100644 --- a/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=true).errors.txt +++ b/tests/baselines/reference/callWithMissingVoidUndefinedUnknownAnyInJs(strict=true).errors.txt @@ -31,28 +31,28 @@ tsfile.ts(12,4): error TS2554: Expected 1 arguments, but got 0. // new behavior: treat 'undefined', 'unknown', and 'any' as optional in non-strict mode f2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:2:21: An argument for 'p' was not provided. f3(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:3:21: An argument for 'p' was not provided. f4(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:4:21: An argument for 'p' was not provided. o2.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. o3.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. o4.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. @@ -63,28 +63,28 @@ tsfile.ts(12,4): error TS2554: Expected 1 arguments, but got 0. // no change in behavior f2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:2:21: An argument for 'p' was not provided. f3(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:3:21: An argument for 'p' was not provided. f4(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:4:21: An argument for 'p' was not provided. o2.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. o3.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. o4.m(); - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 defs.d.ts:6:20: An argument for 'p' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index c97c014caf5..6be00dcf3fb 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -39,7 +39,7 @@ second.ts(17,15): error TS2345: Argument of type 'string' is not assignable to p class Sql extends Wagon { constructor() { super(); // error: not enough arguments - ~~~~~~~ + ~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 first.js:5:16: An argument for 'numberOxen' was not provided. this.foonly = 12 diff --git a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt index e2eccbd533a..dfe42cc9033 100644 --- a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt +++ b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt @@ -15,6 +15,6 @@ derivedTypeCallingBaseImplWithOptionalParams.ts(13,3): error TS2554: Expected 1 var y: MyClass = new MyClass(); y.myMethod(); // error - ~~~~~~~~~~ + ~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 derivedTypeCallingBaseImplWithOptionalParams.ts:5:14: An argument for 'myList' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/es5DateAPIs.errors.txt b/tests/baselines/reference/es5DateAPIs.errors.txt index b761f66034b..a0e07eadf35 100644 --- a/tests/baselines/reference/es5DateAPIs.errors.txt +++ b/tests/baselines/reference/es5DateAPIs.errors.txt @@ -3,6 +3,6 @@ es5DateAPIs.ts(1,6): error TS2554: Expected 2-7 arguments, but got 1. ==== es5DateAPIs.ts (1 errors) ==== Date.UTC(2017); // should error - ~~~~~~~~~ + ~~~ !!! error TS2554: Expected 2-7 arguments, but got 1. !!! related TS6210 lib.es5.d.ts:--:--: An argument for 'monthIndex' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall11.errors.txt b/tests/baselines/reference/functionCall11.errors.txt index 36167f3210b..3688dc235fc 100644 --- a/tests/baselines/reference/functionCall11.errors.txt +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -8,7 +8,7 @@ functionCall11.ts(6,15): error TS2554: Expected 1-2 arguments, but got 3. foo('foo', 1); foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 functionCall11.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt index 680d708b6f5..f9e905d4dbb 100644 --- a/tests/baselines/reference/functionCall12.errors.txt +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -8,7 +8,7 @@ functionCall12.ts(7,15): error TS2345: Argument of type 'number' is not assignab foo('foo', 1); foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1-3 arguments, but got 0. !!! related TS6210 functionCall12.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall13.errors.txt b/tests/baselines/reference/functionCall13.errors.txt index 0b2bd703e27..04c7cb937cb 100644 --- a/tests/baselines/reference/functionCall13.errors.txt +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -7,7 +7,7 @@ functionCall13.ts(5,5): error TS2345: Argument of type 'number' is not assignabl foo('foo', 1); foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 functionCall13.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt index c461889f4f5..6cc09bc1276 100644 --- a/tests/baselines/reference/functionCall16.errors.txt +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -11,7 +11,7 @@ functionCall16.ts(6,5): error TS2345: Argument of type 'number' is not assignabl foo('foo'); foo('foo', 'bar'); foo(); - ~~~~~ + ~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 functionCall16.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall17.errors.txt b/tests/baselines/reference/functionCall17.errors.txt index 62a728b2906..521bc847f48 100644 --- a/tests/baselines/reference/functionCall17.errors.txt +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -11,7 +11,7 @@ functionCall17.ts(6,12): error TS2345: Argument of type 'number' is not assignab !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo'); foo(); - ~~~~~ + ~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 functionCall17.ts:1:14: An argument for 'a' was not provided. foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall18.errors.txt b/tests/baselines/reference/functionCall18.errors.txt index 86698a6119b..884c2d3f904 100644 --- a/tests/baselines/reference/functionCall18.errors.txt +++ b/tests/baselines/reference/functionCall18.errors.txt @@ -6,7 +6,7 @@ functionCall18.ts(4,1): error TS2554: Expected 2 arguments, but got 1. declare function foo(a: T, b: T); declare function foo(a: {}); foo("hello"); - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 functionCall18.ts:2:31: An argument for 'b' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt index d186989e762..014d1f7d86c 100644 --- a/tests/baselines/reference/functionCall6.errors.txt +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -13,7 +13,7 @@ functionCall6.ts(5,1): error TS2554: Expected 1 arguments, but got 0. ~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 functionCall6.ts:1:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 37beda0f15d..b1bfd014fd3 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -15,7 +15,7 @@ functionCall7.ts(7,1): error TS2554: Expected 1 arguments, but got 0. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 functionCall7.ts:2:14: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads29.errors.txt b/tests/baselines/reference/functionOverloads29.errors.txt index e67257e1dce..e21ea49e1b5 100644 --- a/tests/baselines/reference/functionOverloads29.errors.txt +++ b/tests/baselines/reference/functionOverloads29.errors.txt @@ -6,7 +6,7 @@ functionOverloads29.ts(4,9): error TS2554: Expected 1 arguments, but got 0. function foo(bar:number):number; function foo(bar:any):any{ return bar } var x = foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 functionOverloads29.ts:1:14: An argument for 'bar' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads34.errors.txt b/tests/baselines/reference/functionOverloads34.errors.txt index 59b1192c89d..7aaebf1ea93 100644 --- a/tests/baselines/reference/functionOverloads34.errors.txt +++ b/tests/baselines/reference/functionOverloads34.errors.txt @@ -6,7 +6,7 @@ functionOverloads34.ts(4,9): error TS2554: Expected 1 arguments, but got 0. function foo(bar:{a:boolean;}):number; function foo(bar:{a:any;}):any{ return bar } var x = foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 functionOverloads34.ts:1:14: An argument for 'bar' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads37.errors.txt b/tests/baselines/reference/functionOverloads37.errors.txt index 655bef2e0bb..ee6d71b5fca 100644 --- a/tests/baselines/reference/functionOverloads37.errors.txt +++ b/tests/baselines/reference/functionOverloads37.errors.txt @@ -6,7 +6,7 @@ functionOverloads37.ts(4,9): error TS2554: Expected 1 arguments, but got 0. function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 functionOverloads37.ts:1:14: An argument for 'bar' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/functionParameterArityMismatch.errors.txt b/tests/baselines/reference/functionParameterArityMismatch.errors.txt index 8b7cea23207..1f4965f8c20 100644 --- a/tests/baselines/reference/functionParameterArityMismatch.errors.txt +++ b/tests/baselines/reference/functionParameterArityMismatch.errors.txt @@ -12,11 +12,11 @@ functionParameterArityMismatch.ts(15,19): error TS2554: Expected 0-6 arguments, declare function f1(a: number); declare function f1(a: number, b: number, c: number); f1(); - ~~~~ + ~~ !!! error TS2554: Expected 1-3 arguments, but got 0. !!! related TS6210 functionParameterArityMismatch.ts:1:21: An argument for 'a' was not provided. f1(1, 2); - ~~~~~~~~ + ~~ !!! error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 3 arguments. f1(1, 2, 3, 4); ~ @@ -27,13 +27,13 @@ functionParameterArityMismatch.ts(15,19): error TS2554: Expected 0-6 arguments, declare function f2(a: number, b: number, c: number, d: number); declare function f2(a: number, b: number, c: number, d: number, e: number, f: number); f2(1); - ~~~~~ + ~~ !!! error TS2575: No overload expects 1 arguments, but overloads do exist that expect either 0 or 2 arguments. f2(1, 2, 3); - ~~~~~~~~~~~ + ~~ !!! error TS2575: No overload expects 3 arguments, but overloads do exist that expect either 2 or 4 arguments. f2(1, 2, 3, 4, 5); - ~~~~~~~~~~~~~~~~~ + ~~ !!! error TS2575: No overload expects 5 arguments, but overloads do exist that expect either 4 or 6 arguments. f2(1, 2, 3, 4, 5, 6, 7); ~ diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt index b5a7e58f0c6..87e42423628 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt @@ -9,7 +9,7 @@ genericFunctionsWithOptionalParameters2.ts(7,7): error TS2554: Expected 1-3 argu var utils: Utils; utils.fold(); // error - ~~~~~~ + ~~~~ !!! error TS2554: Expected 1-3 arguments, but got 0. !!! related TS6210 genericFunctionsWithOptionalParameters2.ts:2:15: An argument for 'c' was not provided. utils.fold(null); // no error diff --git a/tests/baselines/reference/genericRestArity.errors.txt b/tests/baselines/reference/genericRestArity.errors.txt index ae33c809077..e4e28ebcbe4 100644 --- a/tests/baselines/reference/genericRestArity.errors.txt +++ b/tests/baselines/reference/genericRestArity.errors.txt @@ -10,7 +10,7 @@ genericRestArity.ts(8,45): error TS2554: Expected 3 arguments, but got 8. ...args: TS): void; call((x: number, y: number) => x + y); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6236 genericRestArity.ts:5:5: Arguments for the rest parameter 'args' were not provided. call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); diff --git a/tests/baselines/reference/genericRestArityStrict.errors.txt b/tests/baselines/reference/genericRestArityStrict.errors.txt index bec9b46e176..55c916a26c0 100644 --- a/tests/baselines/reference/genericRestArityStrict.errors.txt +++ b/tests/baselines/reference/genericRestArityStrict.errors.txt @@ -10,7 +10,7 @@ genericRestArityStrict.ts(8,45): error TS2554: Expected 3 arguments, but got 8. ...args: TS): void; call((x: number, y: number) => x + y); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6236 genericRestArityStrict.ts:5:5: Arguments for the rest parameter 'args' were not provided. call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); diff --git a/tests/baselines/reference/genericRestParameters3.errors.txt b/tests/baselines/reference/genericRestParameters3.errors.txt index 914a9f21240..5e072df85e9 100644 --- a/tests/baselines/reference/genericRestParameters3.errors.txt +++ b/tests/baselines/reference/genericRestParameters3.errors.txt @@ -90,7 +90,7 @@ genericRestParameters3.ts(59,5): error TS2345: Argument of type '["what"]' is no declare function foo(cb: (...args: T) => void): void; foo>(); // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 genericRestParameters3.ts:33:39: An argument for 'cb' was not provided. foo>(100); // Error diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt index ed6c97821e4..c6b51107ff9 100644 --- a/tests/baselines/reference/iterableArrayPattern25.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -4,5 +4,5 @@ iterableArrayPattern25.ts(2,1): error TS2554: Expected 2 arguments, but got 1. ==== iterableArrayPattern25.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt b/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt index 2bc8e0f4452..83cde6079b3 100644 --- a/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt +++ b/tests/baselines/reference/jsFileFunctionParametersAsOptional2.errors.txt @@ -14,15 +14,15 @@ bar.ts(3,1): error TS2554: Expected 3 arguments, but got 2. ==== bar.ts (3 errors) ==== f(); // Error - ~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 0. !!! related TS6210 foo.js:6:12: An argument for 'a' was not provided. f(1); // Error - ~~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 foo.js:6:15: An argument for 'b' was not provided. f(1, 2); // Error - ~~~~~~~ + ~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6210 foo.js:6:18: An argument for 'c' was not provided. diff --git a/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt b/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt index 75de95aa76e..3eaebfdd981 100644 --- a/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt +++ b/tests/baselines/reference/jsdocTypeTagRequiredParameters.errors.txt @@ -15,15 +15,15 @@ a.js(13,1): error TS2554: Expected 1 arguments, but got 0. } f() // should error - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 a.js:1:21: An argument for '0' was not provided. g() // should error - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 a.js:4:13: An argument for 's' was not provided. h() - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 a.js:7:14: An argument for 's' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/methodChainError.errors.txt b/tests/baselines/reference/methodChainError.errors.txt index d6286b3d7dc..474f440f7e3 100644 --- a/tests/baselines/reference/methodChainError.errors.txt +++ b/tests/baselines/reference/methodChainError.errors.txt @@ -14,7 +14,7 @@ methodChainError.ts(16,6): error TS2349: This expression is not callable. new Builder() .method("a") .method() - ~~~~~~~~ + ~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 methodChainError.ts:3:12: An argument for 'param' was not provided. .method("a"); diff --git a/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt b/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt index 4cf343ecbf2..0c0d26877bc 100644 --- a/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt +++ b/tests/baselines/reference/moduleExportWithExportPropertyAssignment.errors.txt @@ -6,7 +6,7 @@ a.js(4,6): error TS2554: Expected 1 arguments, but got 0. var mod1 = require('./mod1') mod1() mod1.f() // error, not enough arguments - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 mod1.js:4:30: An argument for 'a' was not provided. diff --git a/tests/baselines/reference/optionalParamArgsTest.errors.txt b/tests/baselines/reference/optionalParamArgsTest.errors.txt index 9cd5817c77a..676817d2873 100644 --- a/tests/baselines/reference/optionalParamArgsTest.errors.txt +++ b/tests/baselines/reference/optionalParamArgsTest.errors.txt @@ -137,19 +137,19 @@ optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2 arguments, but got 0 ~ !!! error TS2554: Expected 0 arguments, but got 1. c1o1.C1M2(); - ~~~~~~ + ~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:23:17: An argument for 'C1M2A1' was not provided. i1o1.C1M2(); - ~~~~~~ + ~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:11:10: An argument for 'C1M2A1' was not provided. F2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:45:13: An argument for 'F2A1' was not provided. L2(); - ~~~~ + ~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:50:20: An argument for 'L2A1' was not provided. c1o1.C1M2(1,2); @@ -177,19 +177,19 @@ optionalParamArgsTest.ts(117,1): error TS2554: Expected 1-2 arguments, but got 0 ~ !!! error TS2554: Expected 0-2 arguments, but got 3. c1o1.C1M4(); - ~~~~~~ + ~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:29:17: An argument for 'C1M4A1' was not provided. i1o1.C1M4(); - ~~~~~~ + ~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:13:10: An argument for 'C1M4A1' was not provided. F4(); - ~~~~ + ~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:47:13: An argument for 'F4A1' was not provided. L4(); - ~~~~ + ~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 optionalParamArgsTest.ts:52:20: An argument for 'L4A1' was not provided. diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index c64ba5a8086..a9b811192a6 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -49,7 +49,7 @@ overload1.ts(34,3): error TS2769: No overload matches this call. ~ !!! error TS2554: Expected 1-2 arguments, but got 3. z=x.g(); // no match - ~~~ + ~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 overload1.ts:17:11: An argument for 'n' was not provided. z=x.g(new O.B()); // ambiguous (up and down conversion) diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 36ed4551a5f..1f17771cec3 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -17,7 +17,7 @@ overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, declare function f(arg: number): void; f(); // wrong number of arguments (#25683) - ~~~~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 overloadsAndTypeArgumentArityErrors.ts:8:31: An argument for 'arg' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/privateNameMethod.errors.txt b/tests/baselines/reference/privateNameMethod.errors.txt index 6def39fc175..5467ab6f149 100644 --- a/tests/baselines/reference/privateNameMethod.errors.txt +++ b/tests/baselines/reference/privateNameMethod.errors.txt @@ -13,7 +13,7 @@ privateNameMethod.ts(8,14): error TS2554: Expected 1 arguments, but got 0. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. this.#method() // Error - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 privateNameMethod.ts:2:13: An argument for 'param' was not provided. diff --git a/tests/baselines/reference/privateNameStaticMethod.errors.txt b/tests/baselines/reference/privateNameStaticMethod.errors.txt index 4487678ba5a..7df027b211e 100644 --- a/tests/baselines/reference/privateNameStaticMethod.errors.txt +++ b/tests/baselines/reference/privateNameStaticMethod.errors.txt @@ -13,7 +13,7 @@ privateNameStaticMethod.ts(8,12): error TS2554: Expected 1 arguments, but got 0. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. A1.#method() // Error - ~~~~~~~~~ + ~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 privateNameStaticMethod.ts:2:20: An argument for 'param' was not provided. diff --git a/tests/baselines/reference/requiredInitializedParameter1.errors.txt b/tests/baselines/reference/requiredInitializedParameter1.errors.txt index 88a0bcc1099..15e8abe82c0 100644 --- a/tests/baselines/reference/requiredInitializedParameter1.errors.txt +++ b/tests/baselines/reference/requiredInitializedParameter1.errors.txt @@ -14,7 +14,7 @@ requiredInitializedParameter1.ts(16,1): error TS2554: Expected 3 arguments, but f4(0, 1, 2); f1(0, 1); - ~~~~~~~~ + ~~ !!! error TS2554: Expected 3 arguments, but got 2. !!! related TS6210 requiredInitializedParameter1.ts:1:23: An argument for 'c' was not provided. f2(0, 1); @@ -22,7 +22,7 @@ requiredInitializedParameter1.ts(16,1): error TS2554: Expected 3 arguments, but f4(0, 1); f1(0); - ~~~~~ + ~~ !!! error TS2554: Expected 3 arguments, but got 1. !!! related TS6210 requiredInitializedParameter1.ts:1:16: An argument for 'b' was not provided. f2(0); diff --git a/tests/baselines/reference/restParamsWithNonRestParams.errors.txt b/tests/baselines/reference/restParamsWithNonRestParams.errors.txt index 1898739529d..71e2ddaa978 100644 --- a/tests/baselines/reference/restParamsWithNonRestParams.errors.txt +++ b/tests/baselines/reference/restParamsWithNonRestParams.errors.txt @@ -6,7 +6,7 @@ restParamsWithNonRestParams.ts(4,1): error TS2555: Expected at least 1 arguments foo(); // ok function foo2(a:string, ...b:number[]){} foo2(); // should be an error - ~~~~~~ + ~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 restParamsWithNonRestParams.ts:3:15: An argument for 'a' was not provided. function foo3(a?:string, ...b:number[]){} diff --git a/tests/baselines/reference/simpleRecursionWithBaseCase1.errors.txt b/tests/baselines/reference/simpleRecursionWithBaseCase1.errors.txt index 77c1830dc69..8e17226700f 100644 --- a/tests/baselines/reference/simpleRecursionWithBaseCase1.errors.txt +++ b/tests/baselines/reference/simpleRecursionWithBaseCase1.errors.txt @@ -14,7 +14,7 @@ simpleRecursionWithBaseCase1.ts(31,10): error TS7023: 'fn5' implicitly has retur } } const num: number = fn1(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 simpleRecursionWithBaseCase1.ts:1:14: An argument for 'n' was not provided. @@ -22,7 +22,7 @@ simpleRecursionWithBaseCase1.ts(31,10): error TS7023: 'fn5' implicitly has retur return fn2(n); } const nev: never = fn2(); - ~~~~~ + ~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 simpleRecursionWithBaseCase1.ts:10:14: An argument for 'n' was not provided. diff --git a/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt b/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt index 1b670ba7a9f..97847882fb3 100644 --- a/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt +++ b/tests/baselines/reference/spreadOfParamsFromGeneratorMakesRequiredParams.errors.txt @@ -10,6 +10,6 @@ spreadOfParamsFromGeneratorMakesRequiredParams.ts(6,1): error TS2554: Expected 2 ): any; call(function* (a: 'a') { }); // error, 2nd argument required - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6236 spreadOfParamsFromGeneratorMakesRequiredParams.ts:3:5: Arguments for the rest parameter 'args' were not provided. \ No newline at end of file diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index 997fb49dac8..4a5fe35c9a6 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -69,7 +69,7 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. let c00 = foo.call(undefined, 10, "hello"); let c01 = foo.call(undefined, 10); // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 2. let c02 = foo.call(undefined, 10, 20); // Error ~~ @@ -122,7 +122,7 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. let c10 = c.foo.call(c, 10, "hello"); let c11 = c.foo.call(c, 10); // Error - ~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 2. let c12 = c.foo.call(c, 10, 20); // Error ~~ @@ -159,7 +159,7 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. C.call(c, 10, "hello"); C.call(c, 10); // Error - ~~~~~~~~~~~ + ~~~~ !!! error TS2554: Expected 3 arguments, but got 2. C.call(c, 10, 20); // Error ~~ diff --git a/tests/baselines/reference/templateLiteralsInTypes.errors.txt b/tests/baselines/reference/templateLiteralsInTypes.errors.txt index d13bc602b90..21029f7843f 100644 --- a/tests/baselines/reference/templateLiteralsInTypes.errors.txt +++ b/tests/baselines/reference/templateLiteralsInTypes.errors.txt @@ -6,7 +6,7 @@ templateLiteralsInTypes.ts(3,8): error TS2339: Property 'foo' does not exist on const f = (hdr: string, val: number) => `${hdr}:\t${val}\r\n` as `${string}:\t${number}\r\n`; f("x").foo; - ~~~~~~ + ~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 templateLiteralsInTypes.ts:1:25: An argument for 'val' was not provided. ~~~ diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 1356e69cfeb..6362a162253 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -174,7 +174,7 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h !!! error TS2353: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. ok.f(); // not enough arguments - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 thisTypeInFunctionsNegative.ts:61:46: An argument for 'x' was not provided. ok.f('wrong type'); @@ -196,7 +196,7 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h let c = new C(); c.explicitC(); // not enough arguments - ~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 thisTypeInFunctionsNegative.ts:9:24: An argument for 'm' was not provided. c.explicitC('wrong type'); @@ -206,7 +206,7 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h ~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. c.explicitThis(); // not enough arguments - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 thisTypeInFunctionsNegative.ts:3:30: An argument for 'm' was not provided. c.explicitThis('wrong type 2'); @@ -216,7 +216,7 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. c.implicitThis(); // not enough arguments - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 thisTypeInFunctionsNegative.ts:6:18: An argument for 'm' was not provided. c.implicitThis('wrong type 2'); @@ -226,7 +226,7 @@ thisTypeInFunctionsNegative.ts(178,22): error TS2730: An arrow function cannot h ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. c.explicitProperty(); // not enough arguments - ~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 thisTypeInFunctionsNegative.ts:12:41: An argument for 'm' was not provided. c.explicitProperty('wrong type 3'); diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt index f7f231860ad..8cf4ea8be2f 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt @@ -11,6 +11,6 @@ typeAssertionToGenericFunctionType.ts(6,3): error TS2554: Expected 1 arguments, ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. x.b(); // error - ~~~~~~~~~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 typeAssertionToGenericFunctionType.ts:3:12: An argument for 'x' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 3af5487b201..1206a615f29 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -71,7 +71,7 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 !!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. unionOfDifferentReturnType1(); // error missing parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:12:37: An argument for 'a' was not provided. @@ -83,13 +83,13 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'. unionOfDifferentParameterTypes();// error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:18:40: An argument for 'a' was not provided. var unionOfDifferentNumberOfSignatures: { (a: number): number; } | { (a: number): Date; (a: string): boolean; }; unionOfDifferentNumberOfSignatures(); // error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:23:44: An argument for 'a' was not provided. unionOfDifferentNumberOfSignatures(10); // error - no call signatures @@ -99,11 +99,11 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b: number): number; } ; unionWithDifferentParameterCount();// needs more args - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:28:69: An argument for 'a' was not provided. unionWithDifferentParameterCount("hello");// needs more args - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 unionTypeCallSignatures.ts:28:80: An argument for 'b' was not provided. unionWithDifferentParameterCount("hello", 10);// OK @@ -115,13 +115,13 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. strOrNum = unionWithOptionalParameter1(); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:33:37: An argument for 'a' was not provided. var unionWithOptionalParameter2: { (a: string, b?: number): string; } | { (a: string, b: number): number }; strOrNum = unionWithOptionalParameter2('hello'); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 unionTypeCallSignatures.ts:39:87: An argument for 'b' was not provided. strOrNum = unionWithOptionalParameter2('hello', 10); // error no call signature @@ -129,7 +129,7 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. strOrNum = unionWithOptionalParameter2(); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:39:76: An argument for 'a' was not provided. @@ -140,7 +140,7 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. strOrNum = unionWithOptionalParameter3(); // needs more args - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:45:37: An argument for 'a' was not provided. @@ -152,13 +152,13 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter1(); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:51:33: An argument for 'a' was not provided. var unionWithRestParameter2: { (a: string, ...b: number[]): string; } | { (a: string, b: number): number }; strOrNum = unionWithRestParameter2('hello'); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 unionTypeCallSignatures.ts:58:87: An argument for 'b' was not provided. strOrNum = unionWithRestParameter2('hello', 10); // error no call signature @@ -169,7 +169,7 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter2(); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:58:76: An argument for 'a' was not provided. @@ -181,13 +181,13 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 ~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter3(); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2555: Expected at least 1 arguments, but got 0. !!! related TS6210 unionTypeCallSignatures.ts:65:33: An argument for 'a' was not provided. var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; }; strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 unionTypeCallSignatures.ts:72:76: An argument for 'b' was not provided. strOrNum = unionWithRestParameter4("hello", "world"); diff --git a/tests/baselines/reference/unionTypeCallSignatures4.errors.txt b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt index aec33944383..3a790cf5d99 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt @@ -26,7 +26,7 @@ unionTypeCallSignatures4.ts(25,18): error TS2554: Expected 2 arguments, but got var f12345: F1 | F2 | F3 | F4 | F5; f12345("a"); // error - ~~~~~~~~~~~ + ~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 unionTypeCallSignatures4.ts:5:23: An argument for 'b' was not provided. f12345("a", "b"); diff --git a/tests/baselines/reference/unionTypeReduction2.errors.txt b/tests/baselines/reference/unionTypeReduction2.errors.txt index 3cbed1418cd..2e6789d7e4c 100644 --- a/tests/baselines/reference/unionTypeReduction2.errors.txt +++ b/tests/baselines/reference/unionTypeReduction2.errors.txt @@ -35,7 +35,7 @@ unionTypeReduction2.ts(33,5): error TS2554: Expected 1 arguments, but got 0. function f6(x: (x: 'hello' | undefined) => void, y: (x?: string) => void) { let f = !!true ? x : y; // (x: 'hello' | undefined) => void f(); // Error - ~~~ + ~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 unionTypeReduction2.ts:31:17: An argument for 'x' was not provided. f('hello'); diff --git a/tests/baselines/reference/variadicTuples1.errors.txt b/tests/baselines/reference/variadicTuples1.errors.txt index 0e1af58d56a..a272e389314 100644 --- a/tests/baselines/reference/variadicTuples1.errors.txt +++ b/tests/baselines/reference/variadicTuples1.errors.txt @@ -101,7 +101,7 @@ variadicTuples1.ts(411,7): error TS2322: Type '[boolean, false]' is not assignab foo1(...t1, ...t2, 42, 43, 44); foo1(...t1, ...t2, ...a1); foo1(...t1); // Error - ~~~~~~~~~~~ + ~~~~ !!! error TS2555: Expected at least 3 arguments, but got 2. !!! related TS6210 variadicTuples1.ts:45:45: An argument for 'c' was not provided. foo1(...t1, 45); // Error diff --git a/tests/cases/fourslash/arityErrorAfterSignatureHelp.ts b/tests/cases/fourslash/arityErrorAfterSignatureHelp.ts index d6578ec1288..e6f80141a4a 100644 --- a/tests/cases/fourslash/arityErrorAfterSignatureHelp.ts +++ b/tests/cases/fourslash/arityErrorAfterSignatureHelp.ts @@ -3,9 +3,9 @@ //// //// declare function f(x: string, y: number): any; //// -//// /*1*/f(/*2*/)/*3*/ +//// /*1*/f/*2*/(/*3*/) -goTo.marker("2"); +goTo.marker("3"); verify.signatureHelp({ triggerReason: { kind: "invoked" @@ -19,4 +19,4 @@ verify.signatureHelp({ } }) verify.not.codeFixAvailable() // trigger typecheck -verify.errorExistsBetweenMarkers("1", "3"); +verify.errorExistsBetweenMarkers("1", "2"); diff --git a/tests/cases/fourslash/arityErrorAfterStringCompletions.ts b/tests/cases/fourslash/arityErrorAfterStringCompletions.ts index 7784e3ef70c..eda989a93f0 100644 --- a/tests/cases/fourslash/arityErrorAfterStringCompletions.ts +++ b/tests/cases/fourslash/arityErrorAfterStringCompletions.ts @@ -8,7 +8,7 @@ //// //// declare function addListener(type: K, listener: (ev: Events[K]) => any): void; //// -//// /*1*/addListener("/*2*/")/*3*/ +//// /*1*/addListener/*2*/("/*3*/") -verify.completions({ marker: ["2"], exact: ["click", "drag"] }); -verify.errorExistsBetweenMarkers("1", "3"); +verify.completions({ marker: ["3"], exact: ["click", "drag"] }); +verify.errorExistsBetweenMarkers("1", "2");