diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 25c537f169a..9f1b0abaecf 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3634,9 +3634,8 @@ module ts { (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); } - // The candidate list is in reverse order of declaration, except that groups of signatures with the same parent are - // kept in declaration order. - function collectCandidates(node: CallExpression, signatures: Signature[]): Signature[] { + // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order + function collectCandidates(node: CallExpression, signatures: Signature[]): Signature[]{ var result: Signature[] = []; var lastParent: Node; var pos: number; @@ -3733,15 +3732,22 @@ module ts { return result; } - function isApplicableSignature(node: CallExpression, signature: Signature, relation: Map, excludeArgument: boolean[]) { + function checkApplicableSignature(node: CallExpression, signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === SyntaxKind.StringLiteral ? + // String literals get string literal types unless we're reporting errors + var argType = arg.kind === SyntaxKind.StringLiteral && !reportErrors ? getStringLiteralType(arg) : checkExpression(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - if (!isTypeRelatedTo(argType, paramType, relation)) return false; + // Use argument expression as error location when reporting errors + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; + } } } return true; @@ -3773,7 +3779,9 @@ module ts { inferTypeArguments(candidate, args, excludeArgument); candidate = getSignatureInstantiation(candidate, typeArguments); } - if (!isApplicableSignature(node, candidate, relation, excludeArgument)) break; + if (!checkApplicableSignature(node, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + break; + } var index = excludeArgument ? indexOf(excludeArgument, true) : -1; if (index < 0) { return getReturnTypeOfSignature(candidate); @@ -3781,10 +3789,14 @@ module ts { excludeArgument[index] = false; } } - if (relation === assignableRelation) break; + if (relation === assignableRelation) { + break; + } relation = assignableRelation; } - error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + // No signatures were applicable. Now report errors based on the last applicable signature with + // no arguments excluded from assignability checks. + checkApplicableSignature(node, candidate, relation, undefined, /*reportErrors*/ true); return checkErrorCall(node); } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 3b317262e56..b243ef02d1d 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -195,6 +195,7 @@ module ts { Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, Duplicate_function_implementation: { code: 3034, category: DiagnosticCategory.Error, key: "Duplicate function implementation." }, Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 3036, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Index_signature_is_missing_in_type_0: { code: 4003, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, Index_signatures_are_incompatible_Colon: { code: 4004, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cd4ee3908f8..c088fd4eddc 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -772,7 +772,10 @@ "category": "Error", "code": 3035 }, - + "Argument of type '{0}' is not assignable to parameter of type '{1}'.": { + "category": "Error", + "code": 3036 + }, "Index signature is missing in type '{0}'.": { diff --git a/tests/baselines/reference/arrayAssignmentTest3.errors.txt b/tests/baselines/reference/arrayAssignmentTest3.errors.txt index df36c5d69d8..4214ae5ef82 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest3.errors.txt @@ -11,7 +11,7 @@ var xx = new a(null, 7, new B()); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type 'B' is not assignable to parameter of type 'B[]'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralContextualType.errors.txt b/tests/baselines/reference/arrayLiteralContextualType.errors.txt index 88ccc93e276..e653cfc303a 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.errors.txt +++ b/tests/baselines/reference/arrayLiteralContextualType.errors.txt @@ -27,8 +27,9 @@ var arr = [new Giraffe(), new Elephant()]; foo(arr); // Error because of no contextual type - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type 'IAnimal[]'. +!!! Type '{}' is not assignable to type 'IAnimal'. bar(arr); // Error because of no contextual type - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type '{ [x: number]: IAnimal; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt index ffdffd34a14..78c710a7d50 100644 --- a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt @@ -6,9 +6,11 @@ function fn(cb: IResultCallback) { } fn((a, b) => true); - ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. +!!! Property 'x' is missing in type '(a: any, b: any) => boolean'. fn(function (a, b) { return true; }) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. +!!! Property 'x' is missing in type '(a: any, b: any) => boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug5.errors.txt b/tests/baselines/reference/assignmentCompatBug5.errors.txt index f2871161da1..cd8f24cee3f 100644 --- a/tests/baselines/reference/assignmentCompatBug5.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug5.errors.txt @@ -1,20 +1,22 @@ ==== tests/cases/compiler/assignmentCompatBug5.ts (4 errors) ==== function foo1(x: { a: number; }) { } foo1({ b: 5 }); - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! Argument of type '{ b: number; }' is not assignable to parameter of type '{ a: number; }'. +!!! Property 'a' is missing in type '{ b: number; }'. function foo2(x: number[]) { } foo2(["s", "t"]); - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! Argument of type 'string[]' is not assignable to parameter of type 'number[]'. +!!! Type 'string' is not assignable to type 'number'. function foo3(x: (n: number) =>number) { }; foo3((s:string) => { }); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'. foo3((n) => { return; }); - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index 0b769d4ecf6..2abf97a25de 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -5,8 +5,11 @@ foo({ id: 1234 }); // Ok foo({ id: 1234, name: "hello" }); // Ok foo({ id: 1234, name: false }); // Error, name of wrong type - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +!!! Types of property 'name' are incompatible: +!!! Type 'boolean' is not assignable to type 'string'. foo({ name: "hello" }); // Error, id required but missing - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +!!! Property 'id' is missing in type '{ name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt index 7588d6e08fa..7d84f69b3d2 100644 --- a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt @@ -14,6 +14,6 @@ function Biz(map: IHandlerMap) { } Biz(new Foo()); - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~ +!!! Argument of type 'Foo' is not assignable to parameter of type 'IHandlerMap'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index b6e8cd608c7..fdb719715eb 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -33,17 +33,18 @@ // Should Fail fn(''); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'Applicable'. fn(['']); - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. fn(4); - ~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'Applicable'. fn({}); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'Applicable'. +!!! Property 'apply' is missing in type '{}'. // Should work diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index 50bada3904a..91c3cee4293 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -33,17 +33,18 @@ // Should Fail fn(''); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'Callable'. fn(['']); - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'string[]' is not assignable to parameter of type 'Callable'. fn(4); - ~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'Callable'. fn({}); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'Callable'. +!!! Property 'call' is missing in type '{}'. // Should work diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index e1bd24e2349..a09491ac455 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -26,8 +26,8 @@ ~~~~ !!! 'this' cannot be referenced in current location. class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. ~~~~ !!! 'this' cannot be referenced in current location. diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt index 1f23e15f181..349e8513e70 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt @@ -8,6 +8,6 @@ var test: I1; test("expects boolean instead of string"); // should not error - "test" should not expect a boolean test(true); // should error - string expected - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt index 7dd3e280067..b0df8303150 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -15,6 +15,6 @@ // BUG 822524 var r = x.foo(1); // no error var r2 = x.foo(''); // error - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt index 01eff3e2a60..0448b6d44a0 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -18,5 +18,5 @@ // Ok to go down the chain, but error to try to climb back up (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~ +!!! Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 71361a10847..3cb1395700d 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -6,13 +6,13 @@ var s: S; // Ok to go down the chain, but error to climb up the chain (new Chain(t)).then(tt => s).then(ss => t); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. // But error to try to climb up the chain (new Chain(s)).then(ss => t); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. // Staying at T or S should be fine (new Chain(t)).then(tt => t).then(tt => t).then(tt => t); diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index afb043e8b64..c11e69d12bb 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -19,11 +19,11 @@ var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! Argument of type 'unknown[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/contextualTyping30.errors.txt b/tests/baselines/reference/contextualTyping30.errors.txt index fe41113ea09..259f59faac7 100644 --- a/tests/baselines/reference/contextualTyping30.errors.txt +++ b/tests/baselines/reference/contextualTyping30.errors.txt @@ -1,4 +1,5 @@ ==== tests/cases/compiler/contextualTyping30.ts (1 errors) ==== function foo(param:number[]){}; foo([1, "a"]); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'. +!!! Type '{}' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt index 96068e57226..adf233b4934 100644 --- a/tests/baselines/reference/contextualTyping33.errors.txt +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -1,4 +1,5 @@ ==== tests/cases/compiler/contextualTyping33.ts (1 errors) ==== function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. +!!! Type '{}' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt index a2884fa27bf..2a768d452bf 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -15,9 +15,9 @@ // errors on all 3 lines, bug was that r5 was the only line with errors var f = (x: number) => { return x.toFixed() }; var r5 = _.forEach(c2, f); - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. var r6 = _.forEach(c2, (x) => { return x.toFixed() }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt index 7696ee6efe4..2e3633b4d64 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt @@ -12,5 +12,5 @@ f({}); // Ok f(obj1); // Ok f(obj2); // Error - indexer doesn't match - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~ +!!! Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index b0b923d4550..b34c4902000 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -3,8 +3,8 @@ var n: number = f(4); n = f(); var s: string = f(''); - ~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. s = f(); ~ !!! Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt index 86666ea1ff8..9b933cc439d 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -1,8 +1,8 @@ ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); var x = new foo(true); // Should error - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/functionCall10.errors.txt b/tests/baselines/reference/functionCall10.errors.txt index b2a1d2987c9..5ae80cff0e8 100644 --- a/tests/baselines/reference/functionCall10.errors.txt +++ b/tests/baselines/reference/functionCall10.errors.txt @@ -2,10 +2,10 @@ function foo(...a:number[]){}; foo(0, 1); foo('foo'); - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. foo(); foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall11.errors.txt b/tests/baselines/reference/functionCall11.errors.txt index 2d0d183a98e..91593adb4e5 100644 --- a/tests/baselines/reference/functionCall11.errors.txt +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -6,8 +6,8 @@ ~~~~~ !!! Supplied parameters do not match any signature of call target. foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt index d204fe0274a..1a89772d74e 100644 --- a/tests/baselines/reference/functionCall12.errors.txt +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -6,10 +6,10 @@ ~~~~~ !!! Supplied parameters do not match any signature of call target. foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); foo('foo', 1, 3); - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall13.errors.txt b/tests/baselines/reference/functionCall13.errors.txt index 16277b304fd..72a06c77c94 100644 --- a/tests/baselines/reference/functionCall13.errors.txt +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -6,7 +6,7 @@ ~~~~~ !!! Supplied parameters do not match any signature of call target. foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall14.errors.txt b/tests/baselines/reference/functionCall14.errors.txt index c68c5d582e4..adfd2530532 100644 --- a/tests/baselines/reference/functionCall14.errors.txt +++ b/tests/baselines/reference/functionCall14.errors.txt @@ -4,7 +4,7 @@ foo('foo'); foo(); foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt index 8649a4f6f2a..f29d90f56c2 100644 --- a/tests/baselines/reference/functionCall16.errors.txt +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -1,15 +1,15 @@ ==== tests/cases/compiler/functionCall16.ts (3 errors) ==== function foo(a:string, b?:string, ...c:number[]){} foo('foo', 1); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo'); foo('foo', 'bar'); foo(); ~~~~~ !!! Supplied parameters do not match any signature of call target. foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 'bar', 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall17.errors.txt b/tests/baselines/reference/functionCall17.errors.txt index a1b27913479..f6280586cb2 100644 --- a/tests/baselines/reference/functionCall17.errors.txt +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -1,17 +1,17 @@ ==== tests/cases/compiler/functionCall17.ts (4 errors) ==== function foo(a:string, b?:string, c?:number, ...d:number[]){} foo('foo', 1); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo'); foo(); ~~~~~ !!! Supplied parameters do not match any signature of call target. foo(1, 'bar'); - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 1, 3); - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 'bar', 3, 4); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt index b43134f65aa..c871e15d30a 100644 --- a/tests/baselines/reference/functionCall6.errors.txt +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -2,8 +2,8 @@ function foo(a:string){}; foo('bar'); foo(2); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo('foo', 'bar'); ~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 6c70d7b6a43..d41add08dd3 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -7,8 +7,8 @@ ~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. foo(4); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'c1'. foo(); ~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall8.errors.txt b/tests/baselines/reference/functionCall8.errors.txt index 08ed51c1153..85eee804724 100644 --- a/tests/baselines/reference/functionCall8.errors.txt +++ b/tests/baselines/reference/functionCall8.errors.txt @@ -5,7 +5,7 @@ ~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. foo(4); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. foo(); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall9.errors.txt b/tests/baselines/reference/functionCall9.errors.txt index 94745d8bb37..5feb59f77c6 100644 --- a/tests/baselines/reference/functionCall9.errors.txt +++ b/tests/baselines/reference/functionCall9.errors.txt @@ -3,8 +3,8 @@ foo('foo', 1); foo('foo'); foo('foo','bar'); - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 14e4593997b..3fb2b84fed5 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -4,8 +4,8 @@ function foo(x: T): T { return x; } foo(1); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'Function'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. @@ -28,42 +28,42 @@ var b2: { new (x: T): T }; var r = foo2(new Function()); - ~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. var r2 = foo2((x: string[]) => x); - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. var r6 = foo2(C); - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. var r7 = foo2(b); - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. var r8 = foo2((x: U) => x); // no error expected var r11 = foo2((x: U, y: V) => x); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. var r13 = foo2(C2); - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. var r14 = foo2(b2); - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. interface F2 extends Function { foo: string; } var f2: F2; var r16 = foo2(f2); - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. function fff(x: T, y: U) { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2(x); - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. foo2(y); - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads.errors.txt b/tests/baselines/reference/functionOverloads.errors.txt index 97c771a8d06..1b2e20e5a8d 100644 --- a/tests/baselines/reference/functionOverloads.errors.txt +++ b/tests/baselines/reference/functionOverloads.errors.txt @@ -3,5 +3,5 @@ function foo(bar: string): number; function foo(bar?: string): any { return "" }; var x = foo(5); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 0f37235a5f0..c0023ab9dcd 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -3,5 +3,5 @@ function foo(bar: number): number; function foo(bar: any): any { return bar }; var x = foo(true); - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads27.errors.txt b/tests/baselines/reference/functionOverloads27.errors.txt index 56963cb5a9e..35216e2fe42 100644 --- a/tests/baselines/reference/functionOverloads27.errors.txt +++ b/tests/baselines/reference/functionOverloads27.errors.txt @@ -3,6 +3,6 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } var x = foo(5); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index e277e038a1b..94e9ccc9ab2 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -3,6 +3,9 @@ function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~ +!!! Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! Type '{ a: string; }' is not assignable to type '{ a: boolean; }': +!!! Types of property 'a' are incompatible: +!!! Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 47f268c2931..5d84364f8d2 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -3,6 +3,8 @@ function foo(bar:{a:boolean;}[]):number; function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{}]); - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! Type '{}' is not assignable to type '{ a: boolean; }': +!!! Property 'a' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index 4f1fac11b4d..6d829215cd2 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -12,6 +12,6 @@ var r2 = foo(null); // {} var r3 = foo(new Object()); // {} var r4 = foo(1); // error - ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'Date'. var r5 = foo(new Date()); // no error \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index 4ccaf1d75d6..c92110911ab 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -10,12 +10,12 @@ // more args not allowed var arg2: { cb: new (x: T, y: T) => string }; var r2 = foo(arg2); // error - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'. var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. function foo2(arg: { cb: new(t: T, t2: T) => U }) { return new arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index 0a74a683d29..c185756667a 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -9,11 +9,15 @@ var r = foo(arg); // {} // more args not allowed var r2 = foo({ cb: (x: T, y: T) => '' }); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: any) => string; }'. +!!! Types of property 'cb' are incompatible: +!!! Type '(x: T, y: T) => string' is not assignable to type '(t: any) => string'. var r3 = foo({ cb: (x: string, y: number) => '' }); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. +!!! Types of property 'cb' are incompatible: +!!! Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. function foo2(arg: { cb: (t: T, t2: T) => U }) { return arg.cb(null, null); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index bf249b29d8e..9396e3f2de9 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -13,11 +13,11 @@ var r7 = foo((a: T) => a, (b: T) => b); // T => T // BUG 835518 var r9 = r7(new Date()); // should be ok - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! Argument of type 'Date' is not assignable to parameter of type 'T'. var r10 = r7(1); // error - ~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'T'. } function foo2(a: (x: T) => T, b: (x: T) => T) { @@ -27,8 +27,8 @@ function other3(x: T) { var r7 = foo2((a: T) => a, (b: T) => b); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~ +!!! Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date } @@ -41,5 +41,5 @@ } var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~ +!!! Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt index 95db2884cf0..9551a712b75 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt @@ -3,14 +3,22 @@ var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors var x2 = foo({ x: 3, y: "" }, 4); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! Types of property 'y' are incompatible: +!!! Type 'string' is not assignable to type 'number'. var x3 = foo({ x: 3, y: "" }, 4); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. +!!! Types of property 'x' are incompatible: +!!! Type 'number' is not assignable to type 'string'. var x4 = foo({ x: "", y: 4 }, ""); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. var x5 = foo({ x: "", y: 4 }, ""); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. +!!! Types of property 'y' are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt index 2e66abd8256..4d306264e7d 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt @@ -33,8 +33,8 @@ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r4 = foo(c, d); var r5 = foo(c, d); // error - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'C' is not assignable to parameter of type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt index 9905903370a..1b619f5ce7a 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt @@ -25,7 +25,7 @@ ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r5 = foo(c, d); // error - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'C' is not assignable to parameter of type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 5218e61a2c9..04756285abf 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -30,8 +30,8 @@ var b: { new (x: T, y: T): string }; var r10 = foo6(b); // error - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'. function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 20a7c6f2f8c..7028f0cf38e 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -27,8 +27,8 @@ } var r10 = foo6((x: T, y: T) => ''); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt index a29f1ddc42c..ca5fd616422 100644 --- a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -4,8 +4,8 @@ ~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. var r2 = f(1); - ~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. @@ -21,8 +21,8 @@ var r41 = f(null); var r12 = f(y); - ~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'U' is not assignable to parameter of type 'T'. var r22 = f(y); ~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/genericCombinators2.errors.txt b/tests/baselines/reference/genericCombinators2.errors.txt index 6de8cc66c30..aad1732547a 100644 --- a/tests/baselines/reference/genericCombinators2.errors.txt +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -14,8 +14,8 @@ var c2: Collection; var rf1 = (x: number, y: string) => { return x.toFixed() }; var r5a = _.map(c2, (x, y) => { return x.toFixed() }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. var r5b = _.map(c2, rf1); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~ +!!! Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt index 0ed85b01e62..8b3673de74b 100644 --- a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt +++ b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt @@ -5,6 +5,8 @@ var x: I<{s: string}> x.f({s: 1}) - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. +!!! Types of property 's' are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericNewInterface.errors.txt b/tests/baselines/reference/genericNewInterface.errors.txt index d421e150059..a8574f19eb5 100644 --- a/tests/baselines/reference/genericNewInterface.errors.txt +++ b/tests/baselines/reference/genericNewInterface.errors.txt @@ -1,8 +1,8 @@ ==== tests/cases/compiler/genericNewInterface.ts (2 errors) ==== function createInstance(ctor: new (s: string) => T): T { return new ctor(42); //should be an error - ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. } interface INewable { @@ -11,6 +11,6 @@ function createInstance2(ctor: INewable): T { return new ctor(1024); //should be an error - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 3da6d88715a..a23bec39f0e 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -4,8 +4,8 @@ var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); var a1Gd = makeArrayG(1, ""); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { return [item1, item2, item3]; @@ -13,5 +13,5 @@ var a2Ga = makeArrayGOpt(1, ""); var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt index 30f6c80e0b9..98b077e1a77 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -6,8 +6,8 @@ var x: B; x.foo(1); // no error var f = (x: B) => { return x.foo(1); } // error - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'T'. var f2 = (x: B) => { return x.foo(1); } // error ~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 7ce7326d13a..0eaf7593c56 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -8,7 +8,8 @@ this.test(["hi"]); this.test([]); this.test([1, 2, "hi", 5]); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type 'string[]'. +!!! Type '{}' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 33a8730e96e..bac9dbabf1f 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -61,8 +61,8 @@ var c1: C1; var c2: C2; if1(c1); - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. function of1(n: { a: { a: string; }; b: string; }): number; @@ -70,8 +70,9 @@ function of1(a: any) { return null; } of1({ e: 0, f: 0 }); - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. +!!! Property 'c' is missing in type '{ e: number; f: number; }'. interface IMap { [key:string]:string; diff --git a/tests/baselines/reference/indexSignatureTypeInference.errors.txt b/tests/baselines/reference/indexSignatureTypeInference.errors.txt index 097fef70921..a37e4458543 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeInference.errors.txt @@ -17,7 +17,7 @@ var v1 = numberMapToArray(numberMap); // Ok var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~ +!!! Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. var v1 = stringMapToArray(stringMap); // Ok \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt index 461bc0db5e7..7a1dcbe5a55 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt @@ -12,8 +12,8 @@ // Errors new Derived("", 3); - ~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new Derived(3); - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 07cd6086aa4..c26643584c8 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -31,11 +31,11 @@ // Errors new Derived(3); - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index 20b6b00d4e9..663cb9a56ca 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -31,8 +31,8 @@ x[2]={ color:Color.Green }; x=x.sort(CompareYeux); // parameter mismatch - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~ +!!! Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. // type of z inferred from specialized array type var z=x.sort(CompareEyes); // ok diff --git a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt index 4aabeeae79a..6b7e8309ca7 100644 --- a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt @@ -2,6 +2,6 @@ function foo1(val: string) { } function foo3(x = foo1(123)) { //should error, 123 is not string - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt index 71a9cf4217d..46594d8abe7 100644 --- a/tests/baselines/reference/lambdaArgCrash.errors.txt +++ b/tests/baselines/reference/lambdaArgCrash.errors.txt @@ -30,8 +30,8 @@ !!! Cannot find name 'ItemSet'. super.add(listener); - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! Argument of type '(items: unknown) => void' is not assignable to parameter of type '() => any'. } diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt index 2353947766f..206a12bf885 100644 --- a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt +++ b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt @@ -13,7 +13,7 @@ }); test({ // Should be OK. Last 'thunk' is of correct type - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ thunk: (num: number) => {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ thunk: (str: string) => {} @@ -21,6 +21,10 @@ ~~~~~ !!! Duplicate identifier 'thunk'. }); - ~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. +!!! Types of property 'thunk' are incompatible: +!!! Type '(num: number) => void' is not assignable to type '(str: string) => void': +!!! Types of parameters 'num' and 'str' are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index 027454e4be6..8a525d1a673 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -9,5 +9,5 @@ } var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index 0e45ce8eb74..6e2647bc45d 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -9,8 +9,9 @@ var r5 = map([1, ""], (x) => x.toString()); var r6 = map([1, ""], (x) => x.toString()); var r7 = map([1, ""], (x) => x.toString()); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'. +!!! Type '{}' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/noErrorsInCallback.errors.txt b/tests/baselines/reference/noErrorsInCallback.errors.txt index 7ead7bc3327..cd7c4beb645 100644 --- a/tests/baselines/reference/noErrorsInCallback.errors.txt +++ b/tests/baselines/reference/noErrorsInCallback.errors.txt @@ -3,11 +3,11 @@ constructor(public foo: string) { } } var one = new Bar({}); // Error - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'string'. [].forEach(() => { var two = new Bar({}); // No error? - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'string'. }); \ No newline at end of file diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt index 655bd6f99db..5d7a636f5f1 100644 --- a/tests/baselines/reference/numberToString.errors.txt +++ b/tests/baselines/reference/numberToString.errors.txt @@ -10,7 +10,7 @@ f1(3); f2(3); // error no coercion to string - ~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. f2(3+""); // ok + operator promotes \ No newline at end of file diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt index be9704ab9a4..6b3788ff53e 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt @@ -4,8 +4,8 @@ } } function foo(x = new A(123)) { //should error, 123 is not string - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. }} ~ !!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt index f82baa1e4c2..2d12916ab24 100644 --- a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt @@ -4,5 +4,7 @@ } process({a:true,b:"y"}); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~ +!!! Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. +!!! Types of property 'a' are incompatible: +!!! Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt index 22dca9e99a5..f4eef960bb9 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt @@ -7,16 +7,19 @@ function f2(args: I) { } f2({ hello: 1 }) // error - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~ +!!! Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. +!!! Property 'value' is missing in type '{ hello: number; }'. f2({ value: '' }) // missing toString satisfied by Object's member f2({ value: '', what: 1 }) // missing toString satisfied by Object's member f2({ toString: (s) => s }) // error, missing property value from ArgsString - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. +!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'. f2({ toString: (s: string) => s }) // error, missing property value from ArgsString - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. +!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'. f2({ value: '', toString: (s) => s.uhhh }) // error ~~~~ !!! Property 'uhhh' does not exist on type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index 4d30e0cfcaa..3b6995e0623 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -7,20 +7,26 @@ function f2(args: I2) { } f2({ hello: 1 }) - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~ +!!! Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. +!!! Property 'value' is missing in type '{ hello: number; }'. f2({ value: '' }) - ~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. +!!! Property 'doStuff' is missing in type '{ value: string; }'. f2({ value: '', what: 1 }) - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. +!!! Property 'doStuff' is missing in type '{ value: string; what: number; }'. f2({ toString: (s) => s }) - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. +!!! Property 'value' is missing in type '{ toString: (s: any) => any; }'. f2({ toString: (s: string) => s }) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I2'. +!!! Property 'value' is missing in type '{ toString: (s: string) => string; }'. f2({ value: '', toString: (s) => s.uhhh }) - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. +!!! Property 'doStuff' is missing in type '{ value: string; toString: (s: any) => any; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 3d0eca5c8a1..415a44ebae5 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -43,8 +43,8 @@ ~ !!! Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt index 34d6f43c487..ad3dc56a7f9 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt @@ -12,8 +12,8 @@ cb(hm); cb('uh'); cb(1); // error - ~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. } var cb: (number) => number = (x: number) => 1; diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt index 309d04e1180..201165a56ec 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -15,8 +15,8 @@ var hm = "hm"; callback(hm); callback(1); // error - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. } } diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt index 72d1dd5af25..1369843e9b4 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt @@ -16,5 +16,5 @@ !!! A signature with an implementation cannot use a string literal type. foo("HI"); - ~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~ +!!! Argument of type 'string' is not assignable to parameter of type '"SPAN"'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 15666ec6f1d..a5d0a02969d 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -26,8 +26,8 @@ // No candidate overloads found fn1({}); // Error - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments function fn2(s: string, n: number): number; @@ -42,8 +42,8 @@ // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments fn2('', 0); // Error - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments fn2('', 0); // OK @@ -75,19 +75,19 @@ function fn4() { } fn4('', 3); fn4(3, ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. fn4('', 3); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. fn4(3, ''); ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. @@ -109,11 +109,11 @@ // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. fn4(null, true); // Error - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 65c32ed46c0..389ae265c32 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -26,8 +26,8 @@ // No candidate overloads found new fn1({}); // Error - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments class fn2 { @@ -80,15 +80,15 @@ } new fn4('', 3); new fn4(3, ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new fn4('', 3); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. new fn4(3, ''); // Error ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. @@ -98,11 +98,11 @@ // Generic overloads with constraints called without type arguments but with types that satisfy the constraints new fn4('', 3); new fn4(3, ''); // Error - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new fn4(3, undefined); // Error - ~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints @@ -114,11 +114,11 @@ // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. new fn4(null, true); // Error - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. // Non - generic overloads where contextual typing of function arguments has errors class fn5 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index c026fbe1c84..96dd65c0710 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -26,8 +26,8 @@ // No candidate overloads found new fn1({}); // Error - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type '{}' is not assignable to parameter of type 'number'. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments interface fn2 { @@ -44,8 +44,8 @@ // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK @@ -82,19 +82,19 @@ new fn4('', 3); new fn4(3, ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new fn4('', 3); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. new fn4(3, ''); ~~~~~~ !!! Type 'number' does not satisfy the constraint 'string'. @@ -116,11 +116,11 @@ // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'number'. new fn4(null, true); // Error - ~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'boolean' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt index cc23f5c066b..bd11102dfdd 100644 --- a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt @@ -1,5 +1,5 @@ ==== tests/cases/compiler/overloadResolutionOverCTLambda.ts (1 errors) ==== function foo(b: (item: number) => boolean) { } foo(a => a); // can not convert (number)=>bool to (number)=>number - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~ +!!! Argument of type '(a: number) => number' is not assignable to parameter of type '(item: number) => boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index d5aa2705d1d..c8b65902d26 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -7,8 +7,11 @@ var x1 = foo([{a:true}]); // works var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~ +!!! Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! Type '{ a: string; }' is not assignable to type '{ a: boolean; }': +!!! Types of property 'a' are incompatible: +!!! Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -20,13 +23,17 @@ var x2 = foo2({a:0}); // works var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. +!!! Types of property 'a' are incompatible: +!!! Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; function foo4(bar:{a:string;}):string; function foo4(bar:{a:any;}):any{ return bar }; var x = foo4({a:true}); // error - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~ +!!! Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. +!!! Types of property 'a' are incompatible: +!!! Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt index d89ee5b44ea..a79428f70b6 100644 --- a/tests/baselines/reference/overloadingOnConstants2.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -18,8 +18,8 @@ var a: D = foo("hi", []); // D var b: E = foo("bye", []); // E var c = foo("um", []); // error - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'string' is not assignable to parameter of type '"bye"'. //function bar(x: "hi", items: string[]): D; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index f94e0a2fa6d..58472a41414 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -15,17 +15,17 @@ var result: number = foo(x => new G(x)); // No error, returns number ~~~~~~ !!! Type 'string' is not assignable to type 'number'. - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'D' is not assignable to parameter of type 'A'. var result2: number = foo(x => new G(x)); // No error, returns number - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. ~~~~~~~~ !!! Type 'D' does not satisfy the constraint 'A'. var result3: string = foo(x => { // returns string because the C overload is picked - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var y: G; // error that C does not satisfy constraint ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ @@ -33,6 +33,6 @@ return y; ~~~~~~~~~~~~~ }); - ~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt index 17049fba3b1..2e44fc1df69 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -5,13 +5,13 @@ }; func(s => ({})); // Error for no applicable overload (object type is missing a and b) - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~ +!!! Argument of type '(s: string) => {}' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~ +!!! Argument of type '(s: string) => { a: unknown; }' is not assignable to parameter of type '(s: string) => { a: number; b: number; }'. ~~~~ !!! Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/parser536727.errors.txt b/tests/baselines/reference/parser536727.errors.txt index 1220f55466d..3404c52f536 100644 --- a/tests/baselines/reference/parser536727.errors.txt +++ b/tests/baselines/reference/parser536727.errors.txt @@ -6,9 +6,9 @@ var x = () => g; foo(g); foo(() => g); - ~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'. foo(x); - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type '() => (x: string) => string' is not assignable to parameter of type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode2.errors.txt b/tests/baselines/reference/parserStrictMode2.errors.txt index 98563258c11..bdd4c1b8b3b 100644 --- a/tests/baselines/reference/parserStrictMode2.errors.txt +++ b/tests/baselines/reference/parserStrictMode2.errors.txt @@ -12,5 +12,5 @@ static(); ~~~~~~ !!! Declaration or statement expected. - ~ -!!! '=>' expected. \ No newline at end of file + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/primitiveConstraints2.errors.txt b/tests/baselines/reference/primitiveConstraints2.errors.txt index 556808e674e..c35877b1e26 100644 --- a/tests/baselines/reference/primitiveConstraints2.errors.txt +++ b/tests/baselines/reference/primitiveConstraints2.errors.txt @@ -7,8 +7,8 @@ var x = new C(); x.bar2(2, ""); // should error - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. x.bar2(2, ""); // should error ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index 1ca0a0450f2..3f58540aec6 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -6,8 +6,8 @@ var result = cb(this.value); // should get a fresh type parameter which each then call var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining2.errors.txt b/tests/baselines/reference/promiseChaining2.errors.txt index c03d09ea3db..62a12242558 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -6,8 +6,8 @@ var result = cb(this.value); // should get a fresh type parameter which each then call var z = this.then(x => result).then(x => "abc").then(x => x.length); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 0247f609f1b..0855b7f0f4d 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -78,109 +78,109 @@ var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; var nIPromise: (x: any) => IPromise; var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok @@ -205,8 +205,8 @@ var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 5560711319b..18a7a6a21d5 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -72,116 +72,116 @@ var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); var s3c = s3.then(testFunction3P, testFunction3, testFunction3); var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. var r4: IPromise; var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; var nIPromise: (x: any) => IPromise; var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok @@ -206,14 +206,14 @@ var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. var r12 = testFunction12(x => x); var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 353a8ef7123..ca2ad6fc950 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -67,8 +67,8 @@ var r3: IPromise; var r3a = r3.then(testFunction3, testFunction3, testFunction3); var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); @@ -79,109 +79,109 @@ var sIPromise: (x: any) => IPromise; var sPromise: (x: any) => Promise; var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok var s4: Promise; var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, y?: string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5: IPromise; var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s5: Promise; var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: string) => string) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r6: IPromise; var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s6: Promise; var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: number, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok var r7: IPromise; var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s7: Promise; var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => Promise'. var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: string) => IPromise'. var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? var r8: IPromise; var nIPromise: (x: any) => IPromise; var nPromise: (x: any) => Promise; var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var s8: Promise; var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok var r9: IPromise; var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok @@ -204,12 +204,12 @@ var r11: IPromise; var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. var s11: Promise; var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok @@ -218,6 +218,6 @@ var s12 = testFunction12(x => x); var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt index c13c7b42605..72d7bfd402e 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt @@ -100,8 +100,8 @@ // scenario 2 public getInitialState(): IState { return new State(self); - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Argument of type 'Window' is not assignable to parameter of type 'IMode'. } diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 833fcf386c0..5068438a8ca 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -34,8 +34,8 @@ static g(t: typeof C.g){ } } C.g(3); // error - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. var f4: () => typeof f4; f4 = 3; // error @@ -52,8 +52,8 @@ ~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. f6(""); // ok (function takes an any param) - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. f6(); // ok declare function f7(): typeof f7; @@ -65,6 +65,6 @@ ~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. f7(""); // ok (function takes an any param) - ~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index c8d76791807..76b86daf358 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -6,10 +6,10 @@ } // both are errors x3(1, (x: string) => 1); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); - ~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. ~~~~~~~~~~~~~~ !!! A signature with an implementation cannot use a string literal type. \ No newline at end of file diff --git a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt index 084f797274e..d3a370d1a51 100644 --- a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt +++ b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt @@ -1,5 +1,5 @@ ==== tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts (1 errors) ==== var x = ''; var d = x['charAt']('invalid'); // error - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~ +!!! Argument of type 'string' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt index 13f686be955..541b9a6fd7d 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesA.errors.txt @@ -1,5 +1,5 @@ ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesA.ts (1 errors) ==== declare function foo3(cb: (x: number) => number): typeof cb; var r5 = foo3((x: number) => ''); // error - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt index 2765d6f29b3..55e240c1a6e 100644 --- a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt +++ b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt @@ -4,11 +4,13 @@ callTest() { // these two should give the same error this.test([1, 2, "hi", 5, ]); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'. +!!! Type '{}' is not assignable to type 'number'. this.test([1, 2, "hi", 5]); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Argument of type '{}[]' is not assignable to parameter of type 'number[]'. +!!! Type '{}' is not assignable to type 'number'. } } \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2WithError.errors.txt b/tests/baselines/reference/typeArgInference2WithError.errors.txt index e2f97042c2c..de456ae4b14 100644 --- a/tests/baselines/reference/typeArgInference2WithError.errors.txt +++ b/tests/baselines/reference/typeArgInference2WithError.errors.txt @@ -6,5 +6,5 @@ declare function foo(x?: T, y?: T): T; var z7 = foo("abc", 5); // Error - ~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~ +!!! Argument of type 'string' is not assignable to parameter of type 'Item'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index 55bc4ff5f2b..7113b56013b 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -24,8 +24,8 @@ var someGenerics1: someGenerics1; new someGenerics1(3, 4); new someGenerics1(3, 4); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. new someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type @@ -64,8 +64,8 @@ new someGenerics4(4, () => null); new someGenerics4('', () => 3); new someGenerics4('', (x: string) => ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. new someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type @@ -76,8 +76,8 @@ new someGenerics5(4, () => null); new someGenerics5('', () => 3); new someGenerics5('', (x: string) => ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. new someGenerics5(null, null); // Generic call with multiple arguments of function types that each have parameters of the same generic type @@ -88,8 +88,8 @@ new someGenerics6(n => n, n => n, n => n); new someGenerics6(n => n, n => n, n => n); new someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~ +!!! Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. new someGenerics6((n: number) => n, (n: number) => n, (n: number) => n); // Generic call with multiple arguments of function types that each have parameters of different generic type diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt index 852dc9fb70a..ce7ee8678c3 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt @@ -2,24 +2,24 @@ // Generic call with multiple type parameters and only one used in parameter type annotation function someGenerics1(n: T, m: number) { } someGenerics1(3, 4); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(n: T, f: (x: U) => void) { } someGenerics4('', (x: string) => ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type function someGenerics5(n: T, f: (x: U) => void) { } someGenerics5('', (x: string) => ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. // Generic call with multiple arguments of function types that each have parameters of the same generic type function someGenerics6(a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~ +!!! Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 8caee07c0e4..18952a3a561 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -19,8 +19,8 @@ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. someGenerics1(3, 4); // Valid someGenerics1(3, 4); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. someGenerics1(3, 4); // Error someGenerics1(3, 4); @@ -50,8 +50,8 @@ someGenerics4(4, () => null); // Valid someGenerics4('', () => 3); someGenerics4('', (x: string) => ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. someGenerics4(null, null); // 2 parameter generic call with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type @@ -59,8 +59,8 @@ someGenerics5(4, () => null); // Valid someGenerics5('', () => 3); someGenerics5('', (x: string) => ''); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. someGenerics5(null, null); // Error ~~~~~~ !!! Type 'string' does not satisfy the constraint 'number'. @@ -70,8 +70,8 @@ someGenerics6(n => n, n => n, n => n); // Valid someGenerics6(n => n, n => n, n => n); someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~ +!!! Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. someGenerics6((n: number) => n, (n: number) => n, (n: number) => n); // Generic call with multiple arguments of function types that each have parameters of different generic type @@ -83,8 +83,8 @@ // Generic call with argument of generic function type function someGenerics8(n: T): T { return n; } var x = someGenerics8(someGenerics7); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. x(null, null, null); // Error // Generic call with multiple parameters of generic type passed arguments with no best common type diff --git a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt index e8debfb4e9c..5c724afbadd 100644 --- a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt +++ b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt @@ -4,8 +4,8 @@ ~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. var r2 = f(1); - ~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt index 27edbb73f8e..24bb6fc1f79 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt @@ -4,8 +4,8 @@ b: (x: T) => { x } } x.a(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition - ~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. x.b(); // error ~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt index 334d1d7bf0f..82b546a981e 100644 --- a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt +++ b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt @@ -33,6 +33,6 @@ !!! Type 'X_1' is not assignable to type 'Y_1': !!! Private property 'name' cannot be reimplemented. foo2(a2); // should error - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'Y_1' is not assignable to parameter of type 'X_1'. \ No newline at end of file diff --git a/tests/baselines/reference/typeOfOnTypeArg.errors.txt b/tests/baselines/reference/typeOfOnTypeArg.errors.txt index 455e91c6df0..8734545e007 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.errors.txt +++ b/tests/baselines/reference/typeOfOnTypeArg.errors.txt @@ -6,6 +6,6 @@ } fill(32); - ~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~ +!!! Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/undeclaredModuleError.errors.txt b/tests/baselines/reference/undeclaredModuleError.errors.txt index 4835447df9a..d044b29f76d 100644 --- a/tests/baselines/reference/undeclaredModuleError.errors.txt +++ b/tests/baselines/reference/undeclaredModuleError.errors.txt @@ -9,19 +9,15 @@ function instrumentFile(covFileDir: string, covFileName: string, originalFilePath: string) { fs.readFile(originalFilePath, () => { readdir(covFileDir, () => { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ } , (error: Error, files: {}[]) => { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! Argument of type '() => void' is not assignable to parameter of type '(stat: unknown, name: string) => boolean'. files.forEach((file) => { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var fullPath = join(IDoNotExist); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ !!! Cannot find name 'IDoNotExist'. } ); - ~~~~~~~~~~~~~~~~~~~~ } ); - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. } ); } \ No newline at end of file diff --git a/tests/baselines/reference/vararg.errors.txt b/tests/baselines/reference/vararg.errors.txt index 832c39b1b34..6ac7c5e48b6 100644 --- a/tests/baselines/reference/vararg.errors.txt +++ b/tests/baselines/reference/vararg.errors.txt @@ -35,19 +35,19 @@ var x=new M.C(); var result=""; result+=x.f(x,3,3); // bad first param - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'C' is not assignable to parameter of type 'string'. result+=x.f(3,"hello",3); // bad second param - ~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. result+=x.f("hello",3,3,3,3,3); // ok result+=x.f("hello"); // ok varargs length 0 result+=x.fonly(3); // ok conversion - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'number' is not assignable to parameter of type 'string'. result+=x.fonly(x); // bad param - ~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~ +!!! Argument of type 'C' is not assignable to parameter of type 'string'. result+=x.fonly("a"); // ok result+=x.fonly("a","b","c","d"); //ok diff --git a/tests/baselines/reference/voidArrayLit.errors.txt b/tests/baselines/reference/voidArrayLit.errors.txt index 28ea0a7a6e6..dba674138d0 100644 --- a/tests/baselines/reference/voidArrayLit.errors.txt +++ b/tests/baselines/reference/voidArrayLit.errors.txt @@ -3,6 +3,6 @@ (() => {})(); // ok function foo(s:string) {} foo((()=>{})()); // error - ~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! Argument of type 'void' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt index 24c4c59c137..f2959f53b5d 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt @@ -12,5 +12,5 @@ var c = new C({ length: 2 }); var r = c.foo(''); var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Argument of type '{ length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. \ No newline at end of file