From bbe1faca3c46e490a489bb73f9c64d2d0055ca2e Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Tue, 6 Nov 2018 00:19:02 -0800 Subject: [PATCH 1/6] Fix error message when type argument arity is wrong --- src/compiler/checker.ts | 29 ++++++-- src/compiler/diagnosticMessages.json | 8 +++ ...signingFromObjectToAnythingElse.errors.txt | 8 +-- ...functionTypeArgumentArityErrors.errors.txt | 56 +++++++++++++++ .../functionTypeArgumentArityErrors.js | 38 ++++++++++ .../functionTypeArgumentArityErrors.symbols | 72 +++++++++++++++++++ .../functionTypeArgumentArityErrors.types | 67 +++++++++++++++++ tests/baselines/reference/newMap.errors.txt | 4 +- .../reference/overloadResolution.errors.txt | 4 +- ...loadResolutionClassConstructors.errors.txt | 12 ++-- .../overloadResolutionConstructors.errors.txt | 4 +- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 +-- .../parserConstructorAmbiguity3.errors.txt | 4 +- .../functionTypeArgumentArityErrors.ts | 26 +++++++ 14 files changed, 312 insertions(+), 28 deletions(-) create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.js create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.symbols create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.types create mode 100644 tests/cases/compiler/functionTypeArgumentArityErrors.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b54b13932534e..8a37929646596 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19580,14 +19580,31 @@ namespace ts { } function getTypeArgumentArityError(node: Node, signatures: ReadonlyArray, typeArguments: NodeArray) { - let min = Infinity; - let max = -Infinity; + const argCount = typeArguments.length; + // No overloads exist + if (signatures.length === 1) { + const sig = signatures[0]; + const min = getMinTypeArgumentCount(sig.typeParameters); + const max = length(sig.typeParameters); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min < max ? min + "-" + max : min , argCount); + } + // Overloads exist + let belowArgCount = -Infinity; + let aboveArgCount = Infinity; for (const sig of signatures) { - min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters)); - max = Math.max(max, length(sig.typeParameters)); + const min = getMinTypeArgumentCount(sig.typeParameters); + const max = length(sig.typeParameters); + if (min > argCount) { + aboveArgCount = Math.min(aboveArgCount, min); + } + else if (max < argCount) { + belowArgCount = Math.max(belowArgCount, max); + } + } + if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); } - const paramCount = min === max ? min : min + "-" + max; - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_an_overload_does_exist_that_expects_1_type_arguments, argCount, belowArgCount === -Infinity ? aboveArgCount : belowArgCount); } function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 49f682c4d582d..7b4b118d11cf3 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2509,6 +2509,14 @@ "category": "Error", "code": 2737 }, + "No overload expects {0} type arguments, but an overload does exist that expects {1} type arguments.": { + "category": "Error", + "code": 2738 + }, + "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments.": { + "category": "Error", + "code": 2739 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index bc92c376c7c1d..380af6c52d938 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Property 'exec' is missing in type 'Object'. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Property 'name' is missing in type 'Object'. @@ -19,10 +19,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Ty var a: String = Object.create(""); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. var c: String = Object.create(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. var w: Error = new Object(); ~ diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt new file mode 100644 index 0000000000000..43f8b93dcead4 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2738: No overload expects 5 type arguments, but an overload does exist that expects 4 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type arguments, but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type arguments, but got 3. + + +==== tests/cases/compiler/functionTypeArgumentArityErrors.ts (9 errors) ==== + // Overloaded functions with default type arguments + declare function f1(): void; + declare function f1(): void; + f1(); + ~~~~~~~~~~~~~~ +!!! error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. + f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2738: No overload expects 5 type arguments, but an overload does exist that expects 4 type arguments. + + // Overloaded functions with no default type arguments + declare function f2(): void; + declare function f2(): void; + f2(); + ~~~~~~~~~~~~~~ +!!! error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. + f2(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. + + // Overloaded non-generic functions + declare function f3(): void; + declare function f3(a): void; + f3(); + ~~~~~~ +!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. + + // Generic function with default type parameters + declare function f4(): void; + f4(); + ~~~~~~ +!!! error TS2558: Expected 2-3 type arguments, but got 1. + f4(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2558: Expected 2-3 type arguments, but got 4. + + // Generic function with no default type arguments + declare function f5(): void; + f5(); + ~~~~~~ +!!! error TS2558: Expected 2 type arguments, but got 1. + f5(); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2558: Expected 2 type arguments, but got 3. \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.js b/tests/baselines/reference/functionTypeArgumentArityErrors.js new file mode 100644 index 0000000000000..5ed34450be58b --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.js @@ -0,0 +1,38 @@ +//// [functionTypeArgumentArityErrors.ts] +// Overloaded functions with default type arguments +declare function f1(): void; +declare function f1(): void; +f1(); +f1(); + +// Overloaded functions with no default type arguments +declare function f2(): void; +declare function f2(): void; +f2(); +f2(); + +// Overloaded non-generic functions +declare function f3(): void; +declare function f3(a): void; +f3(); + +// Generic function with default type parameters +declare function f4(): void; +f4(); +f4(); + +// Generic function with no default type arguments +declare function f5(): void; +f5(); +f5(); + +//// [functionTypeArgumentArityErrors.js] +f1(); +f1(); +f2(); +f2(); +f3(); +f4(); +f4(); +f5(); +f5(); diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.symbols b/tests/baselines/reference/functionTypeArgumentArityErrors.symbols new file mode 100644 index 0000000000000..48c702f968b46 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.symbols @@ -0,0 +1,72 @@ +=== tests/cases/compiler/functionTypeArgumentArityErrors.ts === +// Overloaded functions with default type arguments +declare function f1(): void; +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 1, 20)) + +declare function f1(): void; +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 2, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 2, 22)) +>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 2, 25)) +>D : Symbol(D, Decl(functionTypeArgumentArityErrors.ts, 2, 28)) + +f1(); +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) + +f1(); +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) + +// Overloaded functions with no default type arguments +declare function f2(): void; +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 7, 20)) + +declare function f2(): void; +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 8, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 8, 22)) +>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 8, 25)) + +f2(); +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) + +f2(); +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) + +// Overloaded non-generic functions +declare function f3(): void; +>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28)) + +declare function f3(a): void; +>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28)) +>a : Symbol(a, Decl(functionTypeArgumentArityErrors.ts, 14, 20)) + +f3(); +>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28)) + +// Generic function with default type parameters +declare function f4(): void; +>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 18, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 18, 22)) +>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 18, 25)) + +f4(); +>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13)) + +f4(); +>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13)) + +// Generic function with no default type arguments +declare function f5(): void; +>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 23, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 23, 22)) + +f5(); +>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37)) + +f5(); +>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37)) + diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.types b/tests/baselines/reference/functionTypeArgumentArityErrors.types new file mode 100644 index 0000000000000..c91cf39674fe8 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.types @@ -0,0 +1,67 @@ +=== tests/cases/compiler/functionTypeArgumentArityErrors.ts === +// Overloaded functions with default type arguments +declare function f1(): void; +>f1 : { (): void; (): void; } + +declare function f1(): void; +>f1 : { (): void; (): void; } + +f1(); +>f1() : any +>f1 : { (): void; (): void; } + +f1(); +>f1() : any +>f1 : { (): void; (): void; } + +// Overloaded functions with no default type arguments +declare function f2(): void; +>f2 : { (): void; (): void; } + +declare function f2(): void; +>f2 : { (): void; (): void; } + +f2(); +>f2() : any +>f2 : { (): void; (): void; } + +f2(); +>f2() : any +>f2 : { (): void; (): void; } + +// Overloaded non-generic functions +declare function f3(): void; +>f3 : { (): void; (a: any): void; } + +declare function f3(a): void; +>f3 : { (): void; (a: any): void; } +>a : any + +f3(); +>f3() : any +>f3 : { (): void; (a: any): void; } + +// Generic function with default type parameters +declare function f4(): void; +>f4 : () => void + +f4(); +>f4() : any +>f4 : () => void + +f4(); +>f4() : any +>f4 : () => void + +// Generic function with no default type arguments +declare function f5(): void; +>f5 : () => void + +f5(); +>f5() : any +>f5 : () => void + +f5(); +>f5() : any +>f5 : () => void + diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index 46668890b0714..7760911da2aa0 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2558: Expected 0-2 type arguments, but got 1. +tests/cases/compiler/newMap.ts(1,9): error TS2739: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2558: Expected 0-2 type arguments, but got 1. +!!! error TS2739: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 6710f697b3cd4..c3d68d9a41f09 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 1-3 type arguments, but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-3 type arguments, but got 4. +!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index cfbc26055597b..0ea6dadc2a083 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 3 type arguments. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2738: No overload expects 2 type arguments, but an overload does exist that expects 3 type arguments. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -78,16 +78,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~ -!!! error TS2558: Expected 3 type arguments, but got 1. +!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 3 type arguments. new fn3('', '', ''); // Error ~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type arguments, but got 2. +!!! error TS2738: No overload expects 2 type arguments, but an overload does exist that expects 3 type arguments. new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type arguments, but got 4. +!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index fe1c955651bce..a6e16e40ee79b 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 1-3 type arguments, but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-3 type arguments, but got 4. +!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 1993a6d7f2c7b..6100dbcc1c619 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 0-2 type arguments, but got 3. -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 0-2 type arguments, but got 3. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0-2 type arguments, but got 3. +!!! error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0-2 type arguments, but got 3. +!!! error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt index cd58ed117f60c..54028263ccc6d 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2304: Cannot find name 'A'. -tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,12): error TS1005: '(' expected. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3. ~ !!! error TS2304: Cannot find name 'A'. ~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. !!! error TS1005: '(' expected. \ No newline at end of file diff --git a/tests/cases/compiler/functionTypeArgumentArityErrors.ts b/tests/cases/compiler/functionTypeArgumentArityErrors.ts new file mode 100644 index 0000000000000..a4c9173dfb675 --- /dev/null +++ b/tests/cases/compiler/functionTypeArgumentArityErrors.ts @@ -0,0 +1,26 @@ +// Overloaded functions with default type arguments +declare function f1(): void; +declare function f1(): void; +f1(); +f1(); + +// Overloaded functions with no default type arguments +declare function f2(): void; +declare function f2(): void; +f2(); +f2(); + +// Overloaded non-generic functions +declare function f3(): void; +declare function f3(a): void; +f3(); + +// Generic function with default type parameters +declare function f4(): void; +f4(); +f4(); + +// Generic function with no default type arguments +declare function f5(): void; +f5(); +f5(); \ No newline at end of file From 1720a735827c9d26ac7040ca7138df21c5978237 Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Mon, 12 Nov 2018 18:11:35 -0800 Subject: [PATCH 2/6] Parenthesize 's' in plurals --- src/compiler/checker.ts | 6 +- src/compiler/diagnosticMessages.json | 6 +- ...signingFromObjectToAnythingElse.errors.txt | 8 +-- ...hIncorrectNumberOfTypeArguments.errors.txt | 56 +++++++++---------- ...enericFunctionWithTypeArguments.errors.txt | 28 +++++----- ...lWithWrongNumberOfTypeArguments.errors.txt | 8 +-- ...torInvocationWithTooFewTypeArgs.errors.txt | 4 +- .../emptyTypeArgumentList.errors.txt | 4 +- .../emptyTypeArgumentListWithNew.errors.txt | 4 +- ...functionTypeArgumentArityErrors.errors.txt | 37 ++++++------ .../functionTypeArgumentArityErrors.js | 3 +- ...kedInsideItsContainingFunction1.errors.txt | 24 ++++---- .../genericDefaultsErrors.errors.txt | 8 +-- .../genericWithOpenTypeParameters1.errors.txt | 8 +-- ...sWithWrongNumberOfTypeArguments.errors.txt | 8 +-- ...NonGenericTypeWithTypeArguments.errors.txt | 12 ++-- ...citTypeParameterAndArgumentType.errors.txt | 4 +- tests/baselines/reference/newMap.errors.txt | 4 +- .../reference/overloadResolution.errors.txt | 4 +- ...loadResolutionClassConstructors.errors.txt | 12 ++-- .../overloadResolutionConstructors.errors.txt | 4 +- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 +-- .../parserConstructorAmbiguity3.errors.txt | 4 +- ...CallExpressionWithTypeArguments.errors.txt | 4 +- .../tooManyTypeParameters1.errors.txt | 12 ++-- .../tsxTypeArgumentResolution.errors.txt | 24 ++++---- ...OnFunctionsWithNoTypeParameters.errors.txt | 8 +-- .../reference/typeAssertions.errors.txt | 4 +- ...unctionCallsWithTypeParameters1.errors.txt | 16 +++--- .../functionTypeArgumentArityErrors.ts | 2 +- 30 files changed, 168 insertions(+), 166 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 687d20a358a69..e888e6f777693 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19615,7 +19615,7 @@ namespace ts { const sig = signatures[0]; const min = getMinTypeArgumentCount(sig.typeParameters); const max = length(sig.typeParameters); - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min < max ? min + "-" + max : min , argCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_argument_s_but_got_1, min < max ? min + "-" + max : min , argCount); } // Overloads exist let belowArgCount = -Infinity; @@ -19631,9 +19631,9 @@ namespace ts { } } if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_argument_s_but_overloads_do_exist_that_expect_either_1_or_2_type_argument_s, argCount, belowArgCount, aboveArgCount); } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_an_overload_does_exist_that_expects_1_type_arguments, argCount, belowArgCount === -Infinity ? aboveArgCount : belowArgCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_argument_s_but_an_overload_does_exist_that_expects_1_type_argument_s, argCount, belowArgCount === -Infinity ? aboveArgCount : belowArgCount); } function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 209bf163b2be5..1abb1ba9c1934 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2016,7 +2016,7 @@ "category": "Error", "code": 2557 }, - "Expected {0} type arguments, but got {1}.": { + "Expected {0} type argument(s), but got {1}.": { "category": "Error", "code": 2558 }, @@ -2513,11 +2513,11 @@ "category": "Message", "code": 2738 }, - "No overload expects {0} type arguments, but an overload does exist that expects {1} type arguments.": { + "No overload expects {0} type argument(s), but an overload does exist that expects {1} type argument(s).": { "category": "Error", "code": 2739 }, - "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments.": { + "No overload expects {0} type argument(s), but overloads do exist that expect either {1} or {2} type argument(s).": { "category": "Error", "code": 2740 }, diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index 380af6c52d938..b1da1b504ca32 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Property 'exec' is missing in type 'Object'. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Property 'name' is missing in type 'Object'. @@ -19,10 +19,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Ty var a: String = Object.create(""); ~~~~~~ -!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). var c: String = Object.create(1); ~~~~~~ -!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). var w: Error = new Object(); ~ diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt index d5809d677e4ec..4ac7f64454d6b 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,12): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,13): error TS2558: Expected 2 type arguments, but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,13): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,14): error TS2558: Expected 2 type arguments, but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,13): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,14): error TS2558: Expected 2 type arguments, but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,22): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,23): error TS2558: Expected 2 type arguments, but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,14): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,15): error TS2558: Expected 2 type arguments, but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,23): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,24): error TS2558: Expected 0 type arguments, but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,15): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: Expected 0 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,12): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,13): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,13): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,14): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,13): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,14): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,22): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,23): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,14): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,15): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,23): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,24): error TS2558: Expected 0 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,15): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: Expected 0 type argument(s), but got 3. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (14 errors) ==== @@ -21,26 +21,26 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti function f(x: T, y: U): T { return null; } var r1 = f(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. var r1b = f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. +!!! error TS2558: Expected 2 type argument(s), but got 3. var f2 = (x: T, y: U): T => { return null; } var r2 = f2(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. var r2b = f2(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. +!!! error TS2558: Expected 2 type argument(s), but got 3. var f3: { (x: T, y: U): T; } var r3 = f3(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. var r3b = f3(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. +!!! error TS2558: Expected 2 type argument(s), but got 3. class C { f(x: T, y: U): T { @@ -49,10 +49,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti } var r4 = (new C()).f(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. var r4b = (new C()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. +!!! error TS2558: Expected 2 type argument(s), but got 3. interface I { f(x: T, y: U): T; @@ -60,10 +60,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti var i: I; var r5 = i.f(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. var r5b = i.f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. +!!! error TS2558: Expected 2 type argument(s), but got 3. class C2 { f(x: T, y: U): T { @@ -72,10 +72,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti } var r6 = (new C2()).f(1, ''); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r6b = (new C2()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 3. +!!! error TS2558: Expected 0 type argument(s), but got 3. interface I2 { f(x: T, y: U): T; @@ -83,7 +83,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti var i2: I2; var r7 = i2.f(1, ''); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r7b = i2.f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 3. \ No newline at end of file +!!! error TS2558: Expected 0 type argument(s), but got 3. \ No newline at end of file diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt index 6bfb0c1113ea7..c0725fc563171 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,11): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,13): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,13): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,22): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,14): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,23): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,15): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,11): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,13): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,13): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,22): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,14): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,23): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,15): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(40,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(43,10): error TS2347: Untyped function calls may not accept type arguments. @@ -16,17 +16,17 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun function f(x: number) { return null; } var r = f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var f2 = (x: number) => { return null; } var r2 = f2(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var f3: { (x: number): any; } var r3 = f3(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. class C { f(x: number) { @@ -35,7 +35,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun } var r4 = (new C()).f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. interface I { f(x: number): any; @@ -43,7 +43,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun var i: I; var r5 = i.f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. class C2 { f(x: number) { @@ -52,7 +52,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun } var r6 = (new C2()).f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. interface I2 { f(x: number); @@ -60,7 +60,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun var i2: I2; var r7 = i2.f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var a; var r8 = a(); diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt index c8553e8fc0d0b..8cd8e4b1ef42b 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,3): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,3): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,3): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,3): error TS2558: Expected 2 type argument(s), but got 3. ==== tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts (2 errors) ==== @@ -7,8 +7,8 @@ tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,3): error TS2558: E f(); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. f(); f(); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. \ No newline at end of file +!!! error TS2558: Expected 2 type argument(s), but got 3. \ No newline at end of file diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt index 10dd4ad82fba3..6aa5cd9ce1b24 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2558: Expected 2 type argument(s), but got 1. ==== tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts (1 errors) ==== @@ -12,5 +12,5 @@ tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2 var d = new D(); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentList.errors.txt b/tests/baselines/reference/emptyTypeArgumentList.errors.txt index 395c990a3d9dd..0ad7e5d68f1e8 100644 --- a/tests/baselines/reference/emptyTypeArgumentList.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentList.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument list cannot be empty. -tests/cases/compiler/emptyTypeArgumentList.ts(2,5): error TS2558: Expected 1 type arguments, but got 0. +tests/cases/compiler/emptyTypeArgumentList.ts(2,5): error TS2558: Expected 1 type argument(s), but got 0. ==== tests/cases/compiler/emptyTypeArgumentList.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/emptyTypeArgumentList.ts(2,5): error TS2558: Expected 1 typ ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type arguments, but got 0. \ No newline at end of file +!!! error TS2558: Expected 1 type argument(s), but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt index 92eb250291af0..00bce7cc5bf95 100644 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type argument list cannot be empty. -tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,9): error TS2558: Expected 1 type arguments, but got 0. +tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,9): error TS2558: Expected 1 type argument(s), but got 0. ==== tests/cases/compiler/emptyTypeArgumentListWithNew.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,9): error TS2558: Expecte ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type arguments, but got 0. \ No newline at end of file +!!! error TS2558: Expected 1 type argument(s), but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt index 43f8b93dcead4..dc7afe4231855 100644 --- a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2738: No overload expects 5 type arguments, but an overload does exist that expects 4 type arguments. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type arguments, but got 1. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type arguments, but got 4. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type arguments, but got 1. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2739: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type argument(s), but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type argument(s), but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type argument(s), but got 3. ==== tests/cases/compiler/functionTypeArgumentArityErrors.ts (9 errors) ==== @@ -15,42 +15,43 @@ tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Exp declare function f1(): void; f1(); ~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +!!! error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f1(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 5 type arguments, but an overload does exist that expects 4 type arguments. +!!! error TS2739: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). // Overloaded functions with no default type arguments declare function f2(): void; declare function f2(): void; f2(); ~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +!!! error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Overloaded non-generic functions declare function f3(): void; declare function f3(a): void; f3(); ~~~~~~ -!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). // Generic function with default type parameters declare function f4(): void; f4(); ~~~~~~ -!!! error TS2558: Expected 2-3 type arguments, but got 1. +!!! error TS2558: Expected 2-3 type argument(s), but got 1. f4(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2-3 type arguments, but got 4. +!!! error TS2558: Expected 2-3 type argument(s), but got 4. // Generic function with no default type arguments declare function f5(): void; f5(); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. f5(); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 3. \ No newline at end of file +!!! error TS2558: Expected 2 type argument(s), but got 3. + \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.js b/tests/baselines/reference/functionTypeArgumentArityErrors.js index 5ed34450be58b..9c150bea78be0 100644 --- a/tests/baselines/reference/functionTypeArgumentArityErrors.js +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.js @@ -24,7 +24,8 @@ f4(); // Generic function with no default type arguments declare function f5(): void; f5(); -f5(); +f5(); + //// [functionTypeArgumentArityErrors.js] f1(); diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt index ff4c2235b4925..59e4fa09011d5 100644 --- a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -1,33 +1,33 @@ -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(12,17): error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,17): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,17): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17): error TS2558: Expected 0 type argument(s), but got 1. ==== tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts (8 errors) ==== function foo(x:T, y:U, f: (v: T) => U) { var r1 = f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r2 = f(1); ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r4 = f(null); var r11 = f(x); var r21 = f(x); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r31 = f(null); ~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r41 = f(null); var r12 = f(y); @@ -35,9 +35,9 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17 !!! error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'. var r22 = f(y); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r32 = f(null); ~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r42 = f(null); } \ No newline at end of file diff --git a/tests/baselines/reference/genericDefaultsErrors.errors.txt b/tests/baselines/reference/genericDefaultsErrors.errors.txt index e1dca77d958d0..599c8f3fb88ca 100644 --- a/tests/baselines/reference/genericDefaultsErrors.errors.txt +++ b/tests/baselines/reference/genericDefaultsErrors.errors.txt @@ -3,8 +3,8 @@ tests/cases/compiler/genericDefaultsErrors.ts(4,59): error TS2344: Type 'T' does Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericDefaultsErrors.ts(5,44): error TS2344: Type 'T' does not satisfy the constraint 'number'. tests/cases/compiler/genericDefaultsErrors.ts(6,39): error TS2344: Type 'number' does not satisfy the constraint 'T'. -tests/cases/compiler/genericDefaultsErrors.ts(10,5): error TS2558: Expected 2-3 type arguments, but got 1. -tests/cases/compiler/genericDefaultsErrors.ts(13,5): error TS2558: Expected 2-3 type arguments, but got 4. +tests/cases/compiler/genericDefaultsErrors.ts(10,5): error TS2558: Expected 2-3 type argument(s), but got 1. +tests/cases/compiler/genericDefaultsErrors.ts(13,5): error TS2558: Expected 2-3 type argument(s), but got 4. tests/cases/compiler/genericDefaultsErrors.ts(17,13): error TS2345: Argument of type '"a"' is not assignable to parameter of type 'number'. tests/cases/compiler/genericDefaultsErrors.ts(19,11): error TS2428: All declarations of 'i00' must have identical type parameters. tests/cases/compiler/genericDefaultsErrors.ts(20,11): error TS2428: All declarations of 'i00' must have identical type parameters. @@ -45,12 +45,12 @@ tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2716: Type paramet f11(); // ok f11<1>(); // error ~ -!!! error TS2558: Expected 2-3 type arguments, but got 1. +!!! error TS2558: Expected 2-3 type argument(s), but got 1. f11<1, 2>(); // ok f11<1, 2, 3>(); // ok f11<1, 2, 3, 4>(); // error ~~~~~~~~~~ -!!! error TS2558: Expected 2-3 type arguments, but got 4. +!!! error TS2558: Expected 2-3 type argument(s), but got 4. declare function f12(a?: U): void; f12(); // ok diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt index 6a243650b1eab..70ff8662b4dfc 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. -tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,41): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,41): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expected 0 type argument(s), but got 1. ==== tests/cases/compiler/genericWithOpenTypeParameters1.ts (3 errors) ==== @@ -15,9 +15,9 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expe !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var f2 = (x: B) => { return x.foo(1); } // error ~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var f3 = (x: B) => { return x.foo(1); } // error ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var f4 = (x: B) => { return x.foo(1); } // no error \ No newline at end of file diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt index a09b424b8e170..2837bcf3b25f3 100644 --- a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,15): error TS2558: Expected 1 type arguments, but got 2. -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,15): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,15): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,15): error TS2558: Expected 2 type argument(s), but got 1. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGeneri var c = new C(); ~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. class D { x: T @@ -22,4 +22,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGeneri // BUG 794238 var d = new D(); ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. \ No newline at end of file +!!! error TS2558: Expected 2 type argument(s), but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt index 0457d8cf7edb2..f95e58bcd635b 100644 --- a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,15): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,17): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,16): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,15): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,17): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,16): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(18,10): error TS2347: Untyped function calls may not accept type arguments. @@ -14,17 +14,17 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGen var c = new C(); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. function Foo(): void { } var r = new Foo(); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var f: { (): void }; var r2 = new f(); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var a: any; // BUG 790977 diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index 1dace59f7223a..fa46ca025e2a9 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,34): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,15): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,15): error TS2558: Expected 2 type argument(s), but got 1. ==== tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts (2 errors) ==== @@ -17,5 +17,5 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,15): e !!! error TS2322: Type 'string' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~ -!!! error TS2558: Expected 2 type arguments, but got 1. +!!! error TS2558: Expected 2 type argument(s), but got 1. var r8 = map([1, ""], (x) => x.toString()); \ No newline at end of file diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index 7760911da2aa0..8e6d19c83b76d 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2739: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. +tests/cases/compiler/newMap.ts(1,9): error TS2740: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2739: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. +!!! error TS2740: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index c3d68d9a41f09..356159b097600 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 0ea6dadc2a083..2c0aef98901de 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 3 type arguments. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2738: No overload expects 2 type arguments, but an overload does exist that expects 3 type arguments. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2739: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -78,16 +78,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~ -!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 3 type arguments. +!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). new fn3('', '', ''); // Error ~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 2 type arguments, but an overload does exist that expects 3 type arguments. +!!! error TS2739: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index a6e16e40ee79b..db23f981d7ee2 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 4 type arguments, but an overload does exist that expects 3 type arguments. +!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 6100dbcc1c619..bb57df849f73a 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. +!!! error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2738: No overload expects 3 type arguments, but an overload does exist that expects 2 type arguments. +!!! error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt index 54028263ccc6d..606e7f7eb5cdb 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2304: Cannot find name 'A'. -tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,12): error TS1005: '(' expected. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3. ~ !!! error TS2304: Cannot find name 'A'. ~ -!!! error TS2738: No overload expects 1 type arguments, but an overload does exist that expects 0 type arguments. +!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). !!! error TS1005: '(' expected. \ No newline at end of file diff --git a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt index 22f4632cef8bd..57ad200c6f085 100644 --- a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt +++ b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/thisExpressionInCallExpressionWithTypeArguments.ts(2,32): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/compiler/thisExpressionInCallExpressionWithTypeArguments.ts(2,32): error TS2558: Expected 1 type argument(s), but got 2. ==== tests/cases/compiler/thisExpressionInCallExpressionWithTypeArguments.ts (1 errors) ==== class C { public foo() { [1,2,3].map((x) => { return this; })} ~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. } \ No newline at end of file diff --git a/tests/baselines/reference/tooManyTypeParameters1.errors.txt b/tests/baselines/reference/tooManyTypeParameters1.errors.txt index b966225bef53e..2345936411ffc 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.errors.txt +++ b/tests/baselines/reference/tooManyTypeParameters1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/tooManyTypeParameters1.ts(2,3): error TS2558: Expected 1 type arguments, but got 2. -tests/cases/compiler/tooManyTypeParameters1.ts(5,3): error TS2558: Expected 1 type arguments, but got 2. -tests/cases/compiler/tooManyTypeParameters1.ts(8,15): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/compiler/tooManyTypeParameters1.ts(2,3): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/compiler/tooManyTypeParameters1.ts(5,3): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/compiler/tooManyTypeParameters1.ts(8,15): error TS2558: Expected 1 type argument(s), but got 2. tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type 'I' requires 1 type argument(s). @@ -8,17 +8,17 @@ tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type function f() { } f(); ~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. var x = () => {}; x(); ~~~~~~~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. class C {} var c = new C(); ~~~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. interface I {} var i: I; diff --git a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt index 7b429f073dd37..6c8690e15ec81 100644 --- a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt @@ -1,17 +1,17 @@ tests/cases/conformance/jsx/file.tsx(16,26): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(18,26): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(20,13): error TS2558: Expected 1 type arguments, but got 2. -tests/cases/conformance/jsx/file.tsx(22,13): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/conformance/jsx/file.tsx(20,13): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/conformance/jsx/file.tsx(22,13): error TS2558: Expected 1 type argument(s), but got 2. tests/cases/conformance/jsx/file.tsx(24,12): error TS1099: Type argument list cannot be empty. -tests/cases/conformance/jsx/file.tsx(24,13): error TS2558: Expected 1 type arguments, but got 0. +tests/cases/conformance/jsx/file.tsx(24,13): error TS2558: Expected 1 type argument(s), but got 0. tests/cases/conformance/jsx/file.tsx(26,12): error TS1099: Type argument list cannot be empty. -tests/cases/conformance/jsx/file.tsx(26,13): error TS2558: Expected 1 type arguments, but got 0. +tests/cases/conformance/jsx/file.tsx(26,13): error TS2558: Expected 1 type argument(s), but got 0. tests/cases/conformance/jsx/file.tsx(39,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(41,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. -tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type arguments, but got 3. -tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type arguments, but got 3. +tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type argument(s), but got 3. +tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type argument(s), but got 3. tests/cases/conformance/jsx/file.tsx(51,47): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not assignable to type 'number'. @@ -44,23 +44,23 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not x = a={10} b="hi" />; // error ~~~~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. x = a={10} b="hi">; // error ~~~~~~~~~~ -!!! error TS2558: Expected 1 type arguments, but got 2. +!!! error TS2558: Expected 1 type argument(s), but got 2. x = a={10} b="hi" />; // error ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type arguments, but got 0. +!!! error TS2558: Expected 1 type argument(s), but got 0. x = a={10} b="hi">; // error ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type arguments, but got 0. +!!! error TS2558: Expected 1 type argument(s), but got 0. x= /> // OK @@ -89,11 +89,11 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not x = a="hi" b="hi" />; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-2 type arguments, but got 3. +!!! error TS2558: Expected 1-2 type argument(s), but got 3. x = a="hi" b="hi">; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-2 type arguments, but got 3. +!!! error TS2558: Expected 1-2 type argument(s), but got 3. x = a="hi" b="hi" />; // error ~ diff --git a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt index a162b997c0f6d..19c8675fe9df2 100644 --- a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt +++ b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,15): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,15): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. -tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,15): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,15): error TS2558: Expected 0 type argument(s), but got 1. ==== tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts (3 errors) ==== function foo(f: (v: T) => U) { var r1 = f(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r2 = f(1); ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var r4 = f(null); } \ No newline at end of file diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index ad6065b0755c7..131cb285ca22c 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(5,9): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(5,9): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(31,12): error TS2352: Conversion of type 'SomeOther' to type 'SomeBase' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Property 'p' is missing in type 'SomeOther'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(35,15): error TS2352: Conversion of type 'SomeOther' to type 'SomeDerived' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. @@ -30,7 +30,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err fn1(fn2(4)); // Error ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var a: any; var s: string; diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt index d1a1b0f08f94d..538eb4b39a25e 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(3,12): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(3,12): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(5,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(8,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2420: Class 'C' incorrectly implements interface 'Function'. Property 'apply' is missing in type 'C'. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(18,10): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(22,10): error TS2347: Untyped function calls may not accept type arguments. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(28,12): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(35,4): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(28,12): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(35,4): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2558: Expected 0 type argument(s), but got 1. ==== tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts (9 errors) ==== @@ -15,7 +15,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var x = function () { return; }; var r1 = x(); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. var y: any = x; var r2 = y(); ~~~~~~~~~~~ @@ -53,7 +53,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var z: I; var r6 = z(1); // error ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. interface callable2 { (a: T): T; @@ -62,7 +62,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var c4: callable2; c4(1); ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. interface callable3 { (a: T): T; } @@ -70,6 +70,6 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var c5: callable3; c5(1); // error ~~~~~~ -!!! error TS2558: Expected 0 type arguments, but got 1. +!!! error TS2558: Expected 0 type argument(s), but got 1. \ No newline at end of file diff --git a/tests/cases/compiler/functionTypeArgumentArityErrors.ts b/tests/cases/compiler/functionTypeArgumentArityErrors.ts index a4c9173dfb675..5cf681effa61d 100644 --- a/tests/cases/compiler/functionTypeArgumentArityErrors.ts +++ b/tests/cases/compiler/functionTypeArgumentArityErrors.ts @@ -23,4 +23,4 @@ f4(); // Generic function with no default type arguments declare function f5(): void; f5(); -f5(); \ No newline at end of file +f5(); From 0751d7985f77e1e607bab204c65a0d2565884519 Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Mon, 12 Nov 2018 18:59:30 -0800 Subject: [PATCH 3/6] Update baseline --- ...signingFromObjectToAnythingElse.errors.txt | 8 ++++---- ...functionTypeArgumentArityErrors.errors.txt | 20 +++++++++---------- tests/baselines/reference/newMap.errors.txt | 4 ++-- .../reference/overloadResolution.errors.txt | 4 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +++++------ .../overloadResolutionConstructors.errors.txt | 4 ++-- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 ++++---- .../parserConstructorAmbiguity3.errors.txt | 4 ++-- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index 285b5682b6fec..19981a3673950 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'RegExp': exec, test, source, global, and 4 more. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2558: Expected 0 type arguments, but got 1. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'Error': name, message @@ -16,10 +16,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: Th var a: String = Object.create(""); ~~~~~~ -!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). var c: String = Object.create(1); ~~~~~~ -!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). var w: Error = new Object(); ~ diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt index dc7afe4231855..22605aa34a7c5 100644 --- a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2739: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2742: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type argument(s), but got 1. tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type argument(s), but got 4. tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type argument(s), but got 1. @@ -15,27 +15,27 @@ tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Exp declare function f1(): void; f1(); ~~~~~~~~~~~~~~ -!!! error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f1(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). +!!! error TS2742: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). // Overloaded functions with no default type arguments declare function f2(): void; declare function f2(): void; f2(); ~~~~~~~~~~~~~~ -!!! error TS2740: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Overloaded non-generic functions declare function f3(): void; declare function f3(a): void; f3(); ~~~~~~ -!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). // Generic function with default type parameters declare function f4(): void; diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index 8e6d19c83b76d..4686a66886c99 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2740: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2740: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 356159b097600..918cb9a581818 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 2c0aef98901de..9d92b98ae0105 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2739: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2742: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -78,16 +78,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~ -!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). new fn3('', '', ''); // Error ~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2742: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index db23f981d7ee2..12c1398a5e01d 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index bb57df849f73a..ef98bbd18c644 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +!!! error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2739: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +!!! error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt index 606e7f7eb5cdb..c12ff6ec0d272 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2304: Cannot find name 'A'. -tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,12): error TS1005: '(' expected. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3. ~ !!! error TS2304: Cannot find name 'A'. ~ -!!! error TS2739: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). !!! error TS1005: '(' expected. \ No newline at end of file From ed3e1bfece4f080d0e11f52602ab4392144a492e Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Wed, 14 Nov 2018 14:09:22 -0800 Subject: [PATCH 4/6] Update baseline --- ...signingFromObjectToAnythingElse.errors.txt | 8 ++++---- ...functionTypeArgumentArityErrors.errors.txt | 20 +++++++++---------- tests/baselines/reference/newMap.errors.txt | 4 ++-- .../reference/overloadResolution.errors.txt | 4 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +++++------ .../overloadResolutionConstructors.errors.txt | 4 ++-- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 ++++---- .../parserConstructorAmbiguity3.errors.txt | 4 ++-- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index 19981a3673950..196886248e39e 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'RegExp': exec, test, source, global, and 4 more. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'Error': name, message @@ -16,10 +16,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: Th var a: String = Object.create(""); ~~~~~~ -!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). var c: String = Object.create(1); ~~~~~~ -!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). var w: Error = new Object(); ~ diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt index 22605aa34a7c5..53dc062740d01 100644 --- a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2742: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2743: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type argument(s), but got 1. tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type argument(s), but got 4. tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type argument(s), but got 1. @@ -15,27 +15,27 @@ tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Exp declare function f1(): void; f1(); ~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f1(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). +!!! error TS2743: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). // Overloaded functions with no default type arguments declare function f2(): void; declare function f2(): void; f2(); ~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Overloaded non-generic functions declare function f3(): void; declare function f3(a): void; f3(); ~~~~~~ -!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). // Generic function with default type parameters declare function f4(): void; diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index 4686a66886c99..fe0726a68fc51 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +tests/cases/compiler/newMap.ts(1,9): error TS2744: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +!!! error TS2744: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 918cb9a581818..a8b1ab731410a 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 9d92b98ae0105..9251479ad1b76 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2742: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2743: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -78,16 +78,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~ -!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). new fn3('', '', ''); // Error ~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2743: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 12c1398a5e01d..56508139e9a3b 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index ef98bbd18c644..265b8fd5d0796 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +!!! error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2742: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +!!! error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt index c12ff6ec0d272..daf002f0b5c99 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2304: Cannot find name 'A'. -tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,12): error TS1005: '(' expected. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3. ~ !!! error TS2304: Cannot find name 'A'. ~ -!!! error TS2742: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). !!! error TS1005: '(' expected. \ No newline at end of file From 097ac42b2aa2a7881963dcf72f61ffdbe0aca656 Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Mon, 10 Dec 2018 21:53:47 -0800 Subject: [PATCH 5/6] Use old error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 6 +----- ...signingFromObjectToAnythingElse.errors.txt | 8 ++++---- ...functionTypeArgumentArityErrors.errors.txt | 20 +++++++++---------- tests/baselines/reference/newMap.errors.txt | 4 ++-- .../reference/overloadResolution.errors.txt | 4 ++-- ...loadResolutionClassConstructors.errors.txt | 12 +++++------ .../overloadResolutionConstructors.errors.txt | 4 ++-- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 ++++---- .../parserConstructorAmbiguity3.errors.txt | 4 ++-- 10 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cd2324cd439b0..3e35561151b04 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19813,7 +19813,7 @@ namespace ts { if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_argument_s_but_overloads_do_exist_that_expect_either_1_or_2_type_argument_s, argCount, belowArgCount, aboveArgCount); } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_argument_s_but_an_overload_does_exist_that_expects_1_type_argument_s, argCount, belowArgCount === -Infinity ? aboveArgCount : belowArgCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_argument_s_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e7f937dbfde14..5bd4d266ba8d3 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2529,13 +2529,9 @@ "category": "Error", "code": 2742 }, - "No overload expects {0} type argument(s), but an overload does exist that expects {1} type argument(s).": { - "category": "Error", - "code": 2743 - }, "No overload expects {0} type argument(s), but overloads do exist that expect either {1} or {2} type argument(s).": { "category": "Error", - "code": 2744 + "code": 2743 }, "Import declaration '{0}' is using private name '{1}'.": { diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index 196886248e39e..dd1aefca595b9 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'RegExp': exec, test, source, global, and 4 more. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'Error': name, message @@ -16,10 +16,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: Th var a: String = Object.create(""); ~~~~~~ -!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2558: Expected 0 type argument(s), but got 1. var c: String = Object.create(1); ~~~~~~ -!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2558: Expected 0 type argument(s), but got 1. var w: Error = new Object(); ~ diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt index 53dc062740d01..9abc2969aaa1a 100644 --- a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2743: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2558: Expected 4 type argument(s), but got 5. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2558: Expected 3 type argument(s), but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type argument(s), but got 1. tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type argument(s), but got 4. tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type argument(s), but got 1. @@ -15,27 +15,27 @@ tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Exp declare function f1(): void; f1(); ~~~~~~~~~~~~~~ -!!! error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f1(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 5 type argument(s), but an overload does exist that expects 4 type argument(s). +!!! error TS2558: Expected 4 type argument(s), but got 5. // Overloaded functions with no default type arguments declare function f2(): void; declare function f2(): void; f2(); ~~~~~~~~~~~~~~ -!!! error TS2744: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). f2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2558: Expected 3 type argument(s), but got 4. // Overloaded non-generic functions declare function f3(): void; declare function f3(a): void; f3(); ~~~~~~ -!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2558: Expected 0 type argument(s), but got 1. // Generic function with default type parameters declare function f4(): void; diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index fe0726a68fc51..4686a66886c99 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2744: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2744: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +!!! error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index a8b1ab731410a..a9d12f9e2995f 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type argument(s), but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2558: Expected 3 type argument(s), but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 9251479ad1b76..90d379700dbbf 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2743: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type argument(s), but got 1. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type argument(s), but got 2. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type argument(s), but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -78,16 +78,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~ -!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2558: Expected 3 type argument(s), but got 1. new fn3('', '', ''); // Error ~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 2 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2558: Expected 3 type argument(s), but got 2. new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2558: Expected 3 type argument(s), but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 56508139e9a3b..ffb99d747e1d0 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type argument(s), but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 4 type argument(s), but an overload does exist that expects 3 type argument(s). +!!! error TS2558: Expected 3 type argument(s), but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 265b8fd5d0796..be971c352da2f 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 2 type argument(s), but got 3. tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +!!! error TS2558: Expected 2 type argument(s), but got 3. new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 3 type argument(s), but an overload does exist that expects 2 type argument(s). +!!! error TS2558: Expected 2 type argument(s), but got 3. declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt index daf002f0b5c99..a02e54140c0ba 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2304: Cannot find name 'A'. -tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2558: Expected 0 type argument(s), but got 1. tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,12): error TS1005: '(' expected. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3. ~ !!! error TS2304: Cannot find name 'A'. ~ -!!! error TS2743: No overload expects 1 type argument(s), but an overload does exist that expects 0 type argument(s). +!!! error TS2558: Expected 0 type argument(s), but got 1. !!! error TS1005: '(' expected. \ No newline at end of file From 688eabca974251913103ee9ade17e5fec8f2d581 Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Mon, 10 Dec 2018 22:03:07 -0800 Subject: [PATCH 6/6] Revert parantheses --- src/compiler/checker.ts | 6 +- src/compiler/diagnosticMessages.json | 4 +- ...signingFromObjectToAnythingElse.errors.txt | 8 +-- ...hIncorrectNumberOfTypeArguments.errors.txt | 56 +++++++++---------- ...enericFunctionWithTypeArguments.errors.txt | 28 +++++----- ...lWithWrongNumberOfTypeArguments.errors.txt | 8 +-- ...torInvocationWithTooFewTypeArgs.errors.txt | 4 +- .../emptyTypeArgumentList.errors.txt | 4 +- .../emptyTypeArgumentListWithNew.errors.txt | 4 +- ...functionTypeArgumentArityErrors.errors.txt | 36 ++++++------ ...kedInsideItsContainingFunction1.errors.txt | 24 ++++---- .../genericDefaultsErrors.errors.txt | 8 +-- .../genericWithOpenTypeParameters1.errors.txt | 8 +-- ...sWithWrongNumberOfTypeArguments.errors.txt | 8 +-- ...NonGenericTypeWithTypeArguments.errors.txt | 12 ++-- ...citTypeParameterAndArgumentType.errors.txt | 4 +- tests/baselines/reference/newMap.errors.txt | 4 +- .../reference/overloadResolution.errors.txt | 4 +- ...loadResolutionClassConstructors.errors.txt | 12 ++-- .../overloadResolutionConstructors.errors.txt | 4 +- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 +-- .../parserConstructorAmbiguity3.errors.txt | 4 +- ...CallExpressionWithTypeArguments.errors.txt | 4 +- .../tooManyTypeParameters1.errors.txt | 12 ++-- .../tsxTypeArgumentResolution.errors.txt | 24 ++++---- ...OnFunctionsWithNoTypeParameters.errors.txt | 8 +-- .../reference/typeAssertions.errors.txt | 4 +- ...unctionCallsWithTypeParameters1.errors.txt | 16 +++--- 28 files changed, 163 insertions(+), 163 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3e35561151b04..73c7fb567ac85 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19795,7 +19795,7 @@ namespace ts { const sig = signatures[0]; const min = getMinTypeArgumentCount(sig.typeParameters); const max = length(sig.typeParameters); - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_argument_s_but_got_1, min < max ? min + "-" + max : min , argCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min < max ? min + "-" + max : min , argCount); } // Overloads exist let belowArgCount = -Infinity; @@ -19811,9 +19811,9 @@ namespace ts { } } if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_argument_s_but_overloads_do_exist_that_expect_either_1_or_2_type_argument_s, argCount, belowArgCount, aboveArgCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_argument_s_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5bd4d266ba8d3..f669c0721569b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2012,7 +2012,7 @@ "category": "Error", "code": 2557 }, - "Expected {0} type argument(s), but got {1}.": { + "Expected {0} type arguments, but got {1}.": { "category": "Error", "code": 2558 }, @@ -2529,7 +2529,7 @@ "category": "Error", "code": 2742 }, - "No overload expects {0} type argument(s), but overloads do exist that expect either {1} or {2} type argument(s).": { + "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments.": { "category": "Error", "code": 2743 }, diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index dd1aefca595b9..0a7a3a2db5c4e 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'RegExp': exec, test, source, global, and 4 more. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'Error': name, message @@ -16,10 +16,10 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2696: Th var a: String = Object.create(""); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var c: String = Object.create(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var w: Error = new Object(); ~ diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt index 4ac7f64454d6b..d5809d677e4ec 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,12): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,13): error TS2558: Expected 2 type argument(s), but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,13): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,14): error TS2558: Expected 2 type argument(s), but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,13): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,14): error TS2558: Expected 2 type argument(s), but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,22): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,23): error TS2558: Expected 2 type argument(s), but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,14): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,15): error TS2558: Expected 2 type argument(s), but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,23): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,24): error TS2558: Expected 0 type argument(s), but got 3. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,15): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: Expected 0 type argument(s), but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,12): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,13): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,13): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,14): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,13): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,14): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,22): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,23): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,14): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,15): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,23): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,24): error TS2558: Expected 0 type arguments, but got 3. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,15): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: Expected 0 type arguments, but got 3. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (14 errors) ==== @@ -21,26 +21,26 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti function f(x: T, y: U): T { return null; } var r1 = f(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. var r1b = f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. var f2 = (x: T, y: U): T => { return null; } var r2 = f2(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. var r2b = f2(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. var f3: { (x: T, y: U): T; } var r3 = f3(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. var r3b = f3(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. class C { f(x: T, y: U): T { @@ -49,10 +49,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti } var r4 = (new C()).f(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. var r4b = (new C()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. interface I { f(x: T, y: U): T; @@ -60,10 +60,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti var i: I; var r5 = i.f(1, ''); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. var r5b = i.f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. class C2 { f(x: T, y: U): T { @@ -72,10 +72,10 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti } var r6 = (new C2()).f(1, ''); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r6b = (new C2()).f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 3. +!!! error TS2558: Expected 0 type arguments, but got 3. interface I2 { f(x: T, y: U): T; @@ -83,7 +83,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFuncti var i2: I2; var r7 = i2.f(1, ''); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r7b = i2.f(1, ''); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 3. \ No newline at end of file +!!! error TS2558: Expected 0 type arguments, but got 3. \ No newline at end of file diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt index c0725fc563171..6bfb0c1113ea7 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,11): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,13): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,13): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,22): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,14): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,23): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,15): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(5,11): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(8,13): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(11,13): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(18,22): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(24,14): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(31,23): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(37,15): error TS2558: Expected 0 type arguments, but got 1. tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(40,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts(43,10): error TS2347: Untyped function calls may not accept type arguments. @@ -16,17 +16,17 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun function f(x: number) { return null; } var r = f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var f2 = (x: number) => { return null; } var r2 = f2(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var f3: { (x: number): any; } var r3 = f3(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. class C { f(x: number) { @@ -35,7 +35,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun } var r4 = (new C()).f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. interface I { f(x: number): any; @@ -43,7 +43,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun var i: I; var r5 = i.f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. class C2 { f(x: number) { @@ -52,7 +52,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun } var r6 = (new C2()).f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. interface I2 { f(x: number); @@ -60,7 +60,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFun var i2: I2; var r7 = i2.f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var a; var r8 = a(); diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt index 8cd8e4b1ef42b..c8553e8fc0d0b 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,3): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,3): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(3,3): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,3): error TS2558: Expected 2 type arguments, but got 3. ==== tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts (2 errors) ==== @@ -7,8 +7,8 @@ tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts(5,3): error TS2558: E f(); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. f(); f(); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. \ No newline at end of file +!!! error TS2558: Expected 2 type arguments, but got 3. \ No newline at end of file diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt index 6aa5cd9ce1b24..10dd4ad82fba3 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2558: Expected 2 type arguments, but got 1. ==== tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts (1 errors) ==== @@ -12,5 +12,5 @@ tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2 var d = new D(); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentList.errors.txt b/tests/baselines/reference/emptyTypeArgumentList.errors.txt index 0ad7e5d68f1e8..395c990a3d9dd 100644 --- a/tests/baselines/reference/emptyTypeArgumentList.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentList.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/emptyTypeArgumentList.ts(2,4): error TS1099: Type argument list cannot be empty. -tests/cases/compiler/emptyTypeArgumentList.ts(2,5): error TS2558: Expected 1 type argument(s), but got 0. +tests/cases/compiler/emptyTypeArgumentList.ts(2,5): error TS2558: Expected 1 type arguments, but got 0. ==== tests/cases/compiler/emptyTypeArgumentList.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/emptyTypeArgumentList.ts(2,5): error TS2558: Expected 1 typ ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type argument(s), but got 0. \ No newline at end of file +!!! error TS2558: Expected 1 type arguments, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt index 00bce7cc5bf95..92eb250291af0 100644 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,8): error TS1099: Type argument list cannot be empty. -tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,9): error TS2558: Expected 1 type argument(s), but got 0. +tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,9): error TS2558: Expected 1 type arguments, but got 0. ==== tests/cases/compiler/emptyTypeArgumentListWithNew.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/emptyTypeArgumentListWithNew.ts(2,9): error TS2558: Expecte ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type argument(s), but got 0. \ No newline at end of file +!!! error TS2558: Expected 1 type arguments, but got 0. \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt index 9abc2969aaa1a..22e22785a2487 100644 --- a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2558: Expected 4 type argument(s), but got 5. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). -tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2558: Expected 3 type argument(s), but got 4. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type argument(s), but got 1. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type argument(s), but got 4. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type argument(s), but got 1. -tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2558: Expected 4 type arguments, but got 5. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2558: Expected 3 type arguments, but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type arguments, but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type arguments, but got 3. ==== tests/cases/compiler/functionTypeArgumentArityErrors.ts (9 errors) ==== @@ -15,43 +15,43 @@ tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Exp declare function f1(): void; f1(); ~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. f1(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 4 type argument(s), but got 5. +!!! error TS2558: Expected 4 type arguments, but got 5. // Overloaded functions with no default type arguments declare function f2(): void; declare function f2(): void; f2(); ~~~~~~~~~~~~~~ -!!! error TS2743: No overload expects 2 type argument(s), but overloads do exist that expect either 1 or 3 type argument(s). +!!! error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. f2(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type argument(s), but got 4. +!!! error TS2558: Expected 3 type arguments, but got 4. // Overloaded non-generic functions declare function f3(): void; declare function f3(a): void; f3(); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. // Generic function with default type parameters declare function f4(): void; f4(); ~~~~~~ -!!! error TS2558: Expected 2-3 type argument(s), but got 1. +!!! error TS2558: Expected 2-3 type arguments, but got 1. f4(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2-3 type argument(s), but got 4. +!!! error TS2558: Expected 2-3 type arguments, but got 4. // Generic function with no default type arguments declare function f5(): void; f5(); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. f5(); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt index 59e4fa09011d5..ff4c2235b4925 100644 --- a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -1,33 +1,33 @@ -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(12,17): error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,17): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,17): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17): error TS2558: Expected 0 type arguments, but got 1. ==== tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts (8 errors) ==== function foo(x:T, y:U, f: (v: T) => U) { var r1 = f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r2 = f(1); ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r4 = f(null); var r11 = f(x); var r21 = f(x); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r31 = f(null); ~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r41 = f(null); var r12 = f(y); @@ -35,9 +35,9 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17 !!! error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'. var r22 = f(y); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r32 = f(null); ~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r42 = f(null); } \ No newline at end of file diff --git a/tests/baselines/reference/genericDefaultsErrors.errors.txt b/tests/baselines/reference/genericDefaultsErrors.errors.txt index 599c8f3fb88ca..e1dca77d958d0 100644 --- a/tests/baselines/reference/genericDefaultsErrors.errors.txt +++ b/tests/baselines/reference/genericDefaultsErrors.errors.txt @@ -3,8 +3,8 @@ tests/cases/compiler/genericDefaultsErrors.ts(4,59): error TS2344: Type 'T' does Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericDefaultsErrors.ts(5,44): error TS2344: Type 'T' does not satisfy the constraint 'number'. tests/cases/compiler/genericDefaultsErrors.ts(6,39): error TS2344: Type 'number' does not satisfy the constraint 'T'. -tests/cases/compiler/genericDefaultsErrors.ts(10,5): error TS2558: Expected 2-3 type argument(s), but got 1. -tests/cases/compiler/genericDefaultsErrors.ts(13,5): error TS2558: Expected 2-3 type argument(s), but got 4. +tests/cases/compiler/genericDefaultsErrors.ts(10,5): error TS2558: Expected 2-3 type arguments, but got 1. +tests/cases/compiler/genericDefaultsErrors.ts(13,5): error TS2558: Expected 2-3 type arguments, but got 4. tests/cases/compiler/genericDefaultsErrors.ts(17,13): error TS2345: Argument of type '"a"' is not assignable to parameter of type 'number'. tests/cases/compiler/genericDefaultsErrors.ts(19,11): error TS2428: All declarations of 'i00' must have identical type parameters. tests/cases/compiler/genericDefaultsErrors.ts(20,11): error TS2428: All declarations of 'i00' must have identical type parameters. @@ -45,12 +45,12 @@ tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2716: Type paramet f11(); // ok f11<1>(); // error ~ -!!! error TS2558: Expected 2-3 type argument(s), but got 1. +!!! error TS2558: Expected 2-3 type arguments, but got 1. f11<1, 2>(); // ok f11<1, 2, 3>(); // ok f11<1, 2, 3, 4>(); // error ~~~~~~~~~~ -!!! error TS2558: Expected 2-3 type argument(s), but got 4. +!!! error TS2558: Expected 2-3 type arguments, but got 4. declare function f12(a?: U): void; f12(); // ok diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt index 70ff8662b4dfc..6a243650b1eab 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. -tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,41): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,41): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expected 0 type arguments, but got 1. ==== tests/cases/compiler/genericWithOpenTypeParameters1.ts (3 errors) ==== @@ -15,9 +15,9 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expe !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var f2 = (x: B) => { return x.foo(1); } // error ~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var f3 = (x: B) => { return x.foo(1); } // error ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var f4 = (x: B) => { return x.foo(1); } // no error \ No newline at end of file diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt index 2837bcf3b25f3..a09b424b8e170 100644 --- a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,15): error TS2558: Expected 1 type argument(s), but got 2. -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,15): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(8,15): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts(16,15): error TS2558: Expected 2 type arguments, but got 1. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGeneri var c = new C(); ~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. class D { x: T @@ -22,4 +22,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGeneri // BUG 794238 var d = new D(); ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. \ No newline at end of file +!!! error TS2558: Expected 2 type arguments, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt index f95e58bcd635b..0457d8cf7edb2 100644 --- a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,15): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,17): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,16): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(8,15): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(11,17): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(14,16): error TS2558: Expected 0 type arguments, but got 1. tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts(18,10): error TS2347: Untyped function calls may not accept type arguments. @@ -14,17 +14,17 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGen var c = new C(); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. function Foo(): void { } var r = new Foo(); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var f: { (): void }; var r2 = new f(); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var a: any; // BUG 790977 diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index fa46ca025e2a9..1dace59f7223a 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,34): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,15): error TS2558: Expected 2 type argument(s), but got 1. +tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,15): error TS2558: Expected 2 type arguments, but got 1. ==== tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts (2 errors) ==== @@ -17,5 +17,5 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,15): e !!! error TS2322: Type 'string' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 1. +!!! error TS2558: Expected 2 type arguments, but got 1. var r8 = map([1, ""], (x) => x.toString()); \ No newline at end of file diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index 4686a66886c99..d8a4f1c522214 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2743: No overload expects 1 type argument(s), but overloads do exist that expect either 0 or 2 type argument(s). +!!! error TS2743: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index a9d12f9e2995f..27d0392ca8dbc 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type argument(s), but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type argument(s), but got 4. +!!! error TS2558: Expected 3 type arguments, but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 90d379700dbbf..cfbc26055597b 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type argument(s), but got 1. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type argument(s), but got 2. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type argument(s), but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -78,16 +78,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ~~~~~~ -!!! error TS2558: Expected 3 type argument(s), but got 1. +!!! error TS2558: Expected 3 type arguments, but got 1. new fn3('', '', ''); // Error ~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type argument(s), but got 2. +!!! error TS2558: Expected 3 type arguments, but got 2. new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type argument(s), but got 4. +!!! error TS2558: Expected 3 type arguments, but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints class fn4 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index ffb99d747e1d0..2e09a84d13818 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type argument(s), but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 3 type argument(s), but got 4. +!!! error TS2558: Expected 3 type arguments, but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index be971c352da2f..6b64cd8a77311 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 2 type argument(s), but got 3. -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 2 type argument(s), but got 3. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 2 type arguments, but got 3. tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 2 type argument(s), but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt index a02e54140c0ba..cd58ed117f60c 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserConstructorAmbiguity3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2304: Cannot find name 'A'. -tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,10): error TS2558: Expected 0 type arguments, but got 1. tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts(1,12): error TS1005: '(' expected. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3. ~ !!! error TS2304: Cannot find name 'A'. ~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. !!! error TS1005: '(' expected. \ No newline at end of file diff --git a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt index 57ad200c6f085..22f4632cef8bd 100644 --- a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt +++ b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/thisExpressionInCallExpressionWithTypeArguments.ts(2,32): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/compiler/thisExpressionInCallExpressionWithTypeArguments.ts(2,32): error TS2558: Expected 1 type arguments, but got 2. ==== tests/cases/compiler/thisExpressionInCallExpressionWithTypeArguments.ts (1 errors) ==== class C { public foo() { [1,2,3].map((x) => { return this; })} ~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. } \ No newline at end of file diff --git a/tests/baselines/reference/tooManyTypeParameters1.errors.txt b/tests/baselines/reference/tooManyTypeParameters1.errors.txt index 2345936411ffc..b966225bef53e 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.errors.txt +++ b/tests/baselines/reference/tooManyTypeParameters1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/tooManyTypeParameters1.ts(2,3): error TS2558: Expected 1 type argument(s), but got 2. -tests/cases/compiler/tooManyTypeParameters1.ts(5,3): error TS2558: Expected 1 type argument(s), but got 2. -tests/cases/compiler/tooManyTypeParameters1.ts(8,15): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/compiler/tooManyTypeParameters1.ts(2,3): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/compiler/tooManyTypeParameters1.ts(5,3): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/compiler/tooManyTypeParameters1.ts(8,15): error TS2558: Expected 1 type arguments, but got 2. tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type 'I' requires 1 type argument(s). @@ -8,17 +8,17 @@ tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type function f() { } f(); ~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. var x = () => {}; x(); ~~~~~~~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. class C {} var c = new C(); ~~~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. interface I {} var i: I; diff --git a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt index 6c8690e15ec81..7b429f073dd37 100644 --- a/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentResolution.errors.txt @@ -1,17 +1,17 @@ tests/cases/conformance/jsx/file.tsx(16,26): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(18,26): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(20,13): error TS2558: Expected 1 type argument(s), but got 2. -tests/cases/conformance/jsx/file.tsx(22,13): error TS2558: Expected 1 type argument(s), but got 2. +tests/cases/conformance/jsx/file.tsx(20,13): error TS2558: Expected 1 type arguments, but got 2. +tests/cases/conformance/jsx/file.tsx(22,13): error TS2558: Expected 1 type arguments, but got 2. tests/cases/conformance/jsx/file.tsx(24,12): error TS1099: Type argument list cannot be empty. -tests/cases/conformance/jsx/file.tsx(24,13): error TS2558: Expected 1 type argument(s), but got 0. +tests/cases/conformance/jsx/file.tsx(24,13): error TS2558: Expected 1 type arguments, but got 0. tests/cases/conformance/jsx/file.tsx(26,12): error TS1099: Type argument list cannot be empty. -tests/cases/conformance/jsx/file.tsx(26,13): error TS2558: Expected 1 type argument(s), but got 0. +tests/cases/conformance/jsx/file.tsx(26,13): error TS2558: Expected 1 type arguments, but got 0. tests/cases/conformance/jsx/file.tsx(39,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(41,14): error TS2344: Type 'Prop' does not satisfy the constraint '{ a: string; }'. -tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type argument(s), but got 3. -tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type argument(s), but got 3. +tests/cases/conformance/jsx/file.tsx(47,14): error TS2558: Expected 1-2 type arguments, but got 3. +tests/cases/conformance/jsx/file.tsx(49,14): error TS2558: Expected 1-2 type arguments, but got 3. tests/cases/conformance/jsx/file.tsx(51,47): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not assignable to type 'number'. @@ -44,23 +44,23 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not x = a={10} b="hi" />; // error ~~~~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. x = a={10} b="hi">; // error ~~~~~~~~~~ -!!! error TS2558: Expected 1 type argument(s), but got 2. +!!! error TS2558: Expected 1 type arguments, but got 2. x = a={10} b="hi" />; // error ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type argument(s), but got 0. +!!! error TS2558: Expected 1 type arguments, but got 0. x = a={10} b="hi">; // error ~~ !!! error TS1099: Type argument list cannot be empty. -!!! error TS2558: Expected 1 type argument(s), but got 0. +!!! error TS2558: Expected 1 type arguments, but got 0. x= /> // OK @@ -89,11 +89,11 @@ tests/cases/conformance/jsx/file.tsx(53,47): error TS2322: Type 'string' is not x = a="hi" b="hi" />; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-2 type argument(s), but got 3. +!!! error TS2558: Expected 1-2 type arguments, but got 3. x = a="hi" b="hi">; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-2 type argument(s), but got 3. +!!! error TS2558: Expected 1-2 type arguments, but got 3. x = a="hi" b="hi" />; // error ~ diff --git a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt index 19c8675fe9df2..a162b997c0f6d 100644 --- a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt +++ b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,15): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,15): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. -tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,15): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,15): error TS2558: Expected 0 type arguments, but got 1. ==== tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts (3 errors) ==== function foo(f: (v: T) => U) { var r1 = f(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r2 = f(1); ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var r4 = f(null); } \ No newline at end of file diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index 4a61852fedf9b..27de59a76453f 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(5,9): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(5,9): error TS2558: Expected 0 type arguments, but got 1. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(31,12): error TS2352: Conversion of type 'SomeOther' to type 'SomeBase' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Property 'p' is missing in type 'SomeOther' but required in type 'SomeBase'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(35,15): error TS2352: Conversion of type 'SomeOther' to type 'SomeDerived' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. @@ -30,7 +30,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err fn1(fn2(4)); // Error ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var a: any; var s: string; diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt index 04ec95fe34da5..e7f5fc99136bd 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(3,12): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(3,12): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(5,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(8,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2420: Class 'C' incorrectly implements interface 'Function'. Type 'C' is missing the following properties from type 'Function': apply, call, bind tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(18,10): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(22,10): error TS2347: Untyped function calls may not accept type arguments. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(28,12): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(35,4): error TS2558: Expected 0 type argument(s), but got 1. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2558: Expected 0 type argument(s), but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(28,12): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(35,4): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2558: Expected 0 type arguments, but got 1. ==== tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts (9 errors) ==== @@ -15,7 +15,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var x = function () { return; }; var r1 = x(); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. var y: any = x; var r2 = y(); ~~~~~~~~~~~ @@ -53,7 +53,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var z: I; var r6 = z(1); // error ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. interface callable2 { (a: T): T; @@ -62,7 +62,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var c4: callable2; c4(1); ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. interface callable3 { (a: T): T; } @@ -70,6 +70,6 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,4): error TS2 var c5: callable3; c5(1); // error ~~~~~~ -!!! error TS2558: Expected 0 type argument(s), but got 1. +!!! error TS2558: Expected 0 type arguments, but got 1. \ No newline at end of file