mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
More explicit error message for function signature length mismatches (#51457)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
co-authored by
Jake Bailey
parent
f218a562bf
commit
de31ebecea
@@ -19812,6 +19812,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const sourceHasMoreParameters = !hasEffectiveRestParameter(target) &&
|
||||
(checkMode & SignatureCheckMode.StrictArity ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);
|
||||
if (sourceHasMoreParameters) {
|
||||
if (reportErrors && !(checkMode & SignatureCheckMode.StrictArity)) {
|
||||
// the second condition should be redundant, because there is no error reporting when comparing signatures by strict arity
|
||||
// since it is only done for subtype reduction
|
||||
errorReporter!(Diagnostics.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, getMinArgumentCount(source), targetCount);
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
|
||||
|
||||
@@ -3619,6 +3619,10 @@
|
||||
"category": "Error",
|
||||
"code": 2848
|
||||
},
|
||||
"Target signature provides too few arguments. Expected {0} or more, but got {1}.": {
|
||||
"category": "Error",
|
||||
"code": 2849
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'.
|
||||
Types of property 'f' are incompatible.
|
||||
Type '(key: string) => string' is not assignable to type '() => string'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/addMoreOverloadsToBaseSignature.ts (1 errors) ====
|
||||
@@ -13,6 +14,7 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Int
|
||||
!!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'.
|
||||
!!! error TS2430: Types of property 'f' are incompatible.
|
||||
!!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
f(key: string): string;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(17,3): error TS2345: Argument of
|
||||
Type 'void' is not assignable to type 'number'.
|
||||
tests/cases/compiler/arrowFunctionErrorSpan.ts(18,5): error TS1200: Line terminator not permitted before arrow.
|
||||
tests/cases/compiler/arrowFunctionErrorSpan.ts(21,3): error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'.
|
||||
Target signature provides too few arguments. Expected 4 or more, but got 0.
|
||||
tests/cases/compiler/arrowFunctionErrorSpan.ts(28,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'.
|
||||
Type 'void' is not assignable to type 'number'.
|
||||
tests/cases/compiler/arrowFunctionErrorSpan.ts(32,7): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'.
|
||||
@@ -17,6 +18,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(36,7): error TS2345: Argument of
|
||||
tests/cases/compiler/arrowFunctionErrorSpan.ts(43,5): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'.
|
||||
Type 'void' is not assignable to type 'number'.
|
||||
tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/arrowFunctionErrorSpan.ts (11 errors) ====
|
||||
@@ -64,6 +66,7 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of
|
||||
d) => { });
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(a: any, b: any, c: any, d: any) => void' is not assignable to parameter of type '() => number'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 4 or more, but got 0.
|
||||
|
||||
// single line with a comment
|
||||
f(/*
|
||||
@@ -108,4 +111,5 @@ tests/cases/compiler/arrowFunctionErrorSpan.ts(52,3): error TS2345: Argument of
|
||||
2);
|
||||
~~~~~
|
||||
!!! error TS2345: Argument of type '(_: any) => number' is not assignable to parameter of type '() => number'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
+14
@@ -1,10 +1,17 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ====
|
||||
@@ -26,18 +33,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a = (x: number) => 1; // error, too many required params
|
||||
~
|
||||
!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a = b.a; // ok
|
||||
a = b.a2; // ok
|
||||
a = b.a3; // error
|
||||
~
|
||||
!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a = b.a4; // error
|
||||
~
|
||||
!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a = b.a5; // ok
|
||||
a = b.a6; // error
|
||||
~
|
||||
!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 0.
|
||||
|
||||
var a2: (x?: number) => number;
|
||||
a2 = () => 1; // ok, same number of required params
|
||||
@@ -51,6 +62,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a2 = b.a6; // error
|
||||
~~
|
||||
!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
var a3: (x: number) => number;
|
||||
a3 = () => 1; // ok, fewer required params
|
||||
@@ -59,6 +71,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a3 = (x: number, y: number) => 1; // error, too many required params
|
||||
~~
|
||||
!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3 = b.a; // ok
|
||||
a3 = b.a2; // ok
|
||||
a3 = b.a3; // ok
|
||||
@@ -67,6 +80,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a3 = b.a6; // error
|
||||
~~
|
||||
!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
var a4: (x: number, y?: number) => number;
|
||||
a4 = () => 1; // ok, fewer required params
|
||||
|
||||
+10
@@ -1,8 +1,13 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ====
|
||||
@@ -24,13 +29,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a = b.a3; // error
|
||||
~
|
||||
!!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a = b.a4; // error
|
||||
~
|
||||
!!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a = b.a5; // ok
|
||||
a = b.a6; // error
|
||||
~
|
||||
!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 0.
|
||||
|
||||
var a2: new (x?: number) => number;
|
||||
a2 = b.a; // ok
|
||||
@@ -41,6 +49,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a2 = b.a6; // error
|
||||
~~
|
||||
!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
var a3: new (x: number) => number;
|
||||
a3 = b.a; // ok
|
||||
@@ -51,6 +60,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
a3 = b.a6; // error
|
||||
~~
|
||||
!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
var a4: new (x: number, y?: number) => number;
|
||||
a4 = b.a; // ok
|
||||
|
||||
+12
@@ -1,5 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '<T>() => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
@@ -7,7 +9,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(67,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>() => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
@@ -88,7 +92,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '<T>(x: T) => any' is not assignable to type '<T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '<T>(x: T, y: T) => any' is not assignable to type '<T>(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ====
|
||||
@@ -108,6 +114,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
this.a = (x: T) => null; // error, too many required params
|
||||
~~~~~~
|
||||
!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
this.a2 = () => null; // ok, same T of required params
|
||||
this.a2 = (x?: T) => null; // ok, same T of required params
|
||||
@@ -119,6 +126,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
this.a3 = (x: T, y: T) => null; // error, too many required params
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
this.a4 = () => null; // ok, fewer required params
|
||||
this.a4 = (x?: T, y?: T) => null; // ok, fewer required params
|
||||
@@ -173,9 +181,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
b.a = t.a3;
|
||||
~~~
|
||||
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
b.a = t.a4;
|
||||
~~~
|
||||
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
b.a = t.a5;
|
||||
~~~
|
||||
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>() => T'.
|
||||
@@ -340,6 +350,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
this.a = <T>(x: T) => null; // error, too many required params
|
||||
~~~~~~
|
||||
!!! error TS2322: Type '<T>(x: T) => any' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
this.a2 = <T>() => null; // ok, same T of required params
|
||||
this.a2 = <T>(x?: T) => null; // ok, same T of required params
|
||||
@@ -351,6 +362,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
this.a3 = <T>(x: T, y: T) => null; // error, too many required params
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type '<T>(x: T, y: T) => any' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
this.a4 = <T>() => null; // ok, fewer required params
|
||||
this.a4 = <T>(x?: T, y?: T) => null; // ok, fewer required params
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'.
|
||||
Types of construct signatures are incompatible.
|
||||
Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability44.ts (1 errors) ====
|
||||
@@ -13,4 +14,5 @@ tests/cases/compiler/assignmentCompatability44.ts(5,7): error TS2322: Type 'type
|
||||
!!! error TS2322: Type 'typeof Foo' is not assignable to type 'new () => Foo'.
|
||||
!!! error TS2322: Types of construct signatures are incompatible.
|
||||
!!! error TS2322: Type 'new (x: number) => Foo' is not assignable to type 'new () => Foo'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
|
||||
Types of construct signatures are incompatible.
|
||||
Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability45.ts (1 errors) ====
|
||||
@@ -15,4 +16,5 @@ tests/cases/compiler/assignmentCompatability45.ts(7,7): error TS2322: Type 'type
|
||||
!!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
|
||||
!!! error TS2322: Types of construct signatures are incompatible.
|
||||
!!! error TS2322: Type 'new (x: number) => B' is not assignable to type 'abstract new () => A'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
@@ -3,8 +3,11 @@ tests/cases/conformance/jsdoc/test.js(7,5): error TS2322: Type '(prop: any) => v
|
||||
tests/cases/conformance/jsdoc/test.js(10,12): error TS8030: The type of a function declaration must match the function's signature.
|
||||
tests/cases/conformance/jsdoc/test.js(23,12): error TS8030: The type of a function declaration must match the function's signature.
|
||||
tests/cases/conformance/jsdoc/test.js(27,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/jsdoc/test.js(30,7): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) => void' is not assignable to type '() => void'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsdoc/test.js (7 errors) ====
|
||||
@@ -45,16 +48,19 @@ tests/cases/conformance/jsdoc/test.js(34,3): error TS2322: Type '(more: any) =>
|
||||
const variableWithMoreParameters = function (more) {}; // error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
/** @type {() => void} */
|
||||
const arrowWithMoreParameters = (more) => {}; // error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
({
|
||||
/** @type {() => void} */
|
||||
methodWithMoreParameters(more) {}, // error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '(more: any) => void' is not assignable to type '() => void'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/conformance/salsa/first.js(23,9): error TS2554: Expected 1 arguments, but got 0.
|
||||
tests/cases/conformance/salsa/first.js(31,5): error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'.
|
||||
Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/salsa/first.js(47,24): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type.
|
||||
tests/cases/conformance/salsa/generic.js(19,19): error TS2554: Expected 1 arguments, but got 0.
|
||||
tests/cases/conformance/salsa/generic.js(20,32): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ claim: "ignorant" | "malicious"; }'.
|
||||
@@ -52,6 +53,7 @@ tests/cases/conformance/salsa/second.ts(17,15): error TS2345: Argument of type '
|
||||
~~~~
|
||||
!!! error TS2416: Property 'load' in type 'Sql' is not assignable to the same property in base type 'Wagon'.
|
||||
!!! error TS2416: Type '(files: string[], format: "csv" | "json" | "xmlolololol") => void' is not assignable to type '(supplies?: any[]) => void'.
|
||||
!!! error TS2416: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
if (format === "xmlolololol") {
|
||||
throw new Error("please do not use XML. It was a joke.");
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
|
||||
Types of construct signatures are incompatible.
|
||||
Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'.
|
||||
Types of construct signatures are incompatible.
|
||||
Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ====
|
||||
@@ -27,9 +29,11 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof
|
||||
!!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
|
||||
!!! error TS2322: Types of construct signatures are incompatible.
|
||||
!!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r2: new (x: string) => A = B; // error
|
||||
~~
|
||||
!!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'.
|
||||
!!! error TS2322: Types of construct signatures are incompatible.
|
||||
!!! error TS2322: Type 'new (x: string, data: string) => B' is not assignable to type 'new (x: string) => A'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r3: typeof A = C; // ok
|
||||
@@ -16,6 +16,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian
|
||||
Types of property 'forEach' are incompatible.
|
||||
Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'.
|
||||
Types of parameters 'cb' and 'cb' are incompatible.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covariantCallbacks.ts(69,5): error TS2322: Type 'AList4' is not assignable to type 'BList4'.
|
||||
Types of property 'forEach' are incompatible.
|
||||
Type '(cb: (item: A) => A) => void' is not assignable to type '(cb: (item: B) => B) => void'.
|
||||
@@ -105,6 +106,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/covarian
|
||||
!!! error TS2322: Types of property 'forEach' are incompatible.
|
||||
!!! error TS2322: Type '(cb: (item: A) => void) => void' is not assignable to type '(cb: (item: A, context: any) => void) => void'.
|
||||
!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
}
|
||||
|
||||
interface AList4 {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'.
|
||||
Types of property 'x' are incompatible.
|
||||
Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/derivedInterfaceCallSignature.ts (1 errors) ====
|
||||
@@ -19,6 +20,7 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Inte
|
||||
!!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'.
|
||||
!!! error TS2430: Types of property 'x' are incompatible.
|
||||
!!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
x(x: (data: any, index?: number) => number): D3SvgArea;
|
||||
y(y: (data: any, index?: number) => number): D3SvgArea;
|
||||
y0(): (data: any, index?: number) => number;
|
||||
|
||||
@@ -11,6 +11,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
|
||||
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(26,15): error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'.
|
||||
Type 'new (x: string) => string' provides no match for the signature '(x: string): string'.
|
||||
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(28,16): error TS2345: Argument of type '<U, V>(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(29,16): error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'.
|
||||
Type 'typeof C2' provides no match for the signature '(x: string): string'.
|
||||
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(30,16): error TS2345: Argument of type 'new <T>(x: T) => T' is not assignable to parameter of type '(x: string) => string'.
|
||||
@@ -74,6 +75,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
|
||||
var r11 = foo2(<U, V>(x: U, y: V) => x);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<U, V>(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r13 = foo2(C2);
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'.
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new <T>(x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'.
|
||||
Types of property 'cb' are incompatible.
|
||||
Type 'new <T>(x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'.
|
||||
Types of property 'cb' are incompatible.
|
||||
Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts (2 errors) ====
|
||||
@@ -22,12 +24,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon
|
||||
!!! error TS2345: Argument of type '{ cb: new <T>(x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'.
|
||||
!!! error TS2345: Types of property 'cb' are incompatible.
|
||||
!!! error TS2345: Type 'new <T>(x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var arg3: { cb: new (x: string, y: number) => string };
|
||||
var r3 = foo(arg3); // error
|
||||
~~~~
|
||||
!!! error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'.
|
||||
!!! error TS2345: Types of property 'cb' are incompatible.
|
||||
!!! error TS2345: Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
function foo2<T, U>(arg: { cb: new(t: T, t2: T) => U }) {
|
||||
return new arg.cb(null, null);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '<T>(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,16): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ====
|
||||
@@ -15,10 +17,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
|
||||
var r2 = foo({ cb: <T>(x: T, y: T) => '' }); // error
|
||||
~~
|
||||
!!! error TS2322: Type '<T>(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: unknown) => string; }'
|
||||
var r3 = foo({ cb: (x: string, y: number) => '' }); // error
|
||||
~~
|
||||
!!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS6500 tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: string) => string; }'
|
||||
|
||||
function foo2<T, U>(arg: { cb: (t: T, t2: T) => U }) {
|
||||
|
||||
+2
@@ -1,4 +1,5 @@
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new <T>(x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ====
|
||||
@@ -35,6 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve
|
||||
var r10 = foo6(b); // error
|
||||
~
|
||||
!!! error TS2345: Argument of type 'new <T>(x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
function foo7<T>(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) {
|
||||
return cb;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '<T>(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ====
|
||||
@@ -32,6 +33,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve
|
||||
var r10 = foo6(<T>(x: T, y: T) => ''); // error
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
function foo7<T>(x:T, cb: { (x: T): string; (x: T, y?: T): string }) {
|
||||
return cb;
|
||||
|
||||
@@ -29,6 +29,7 @@ tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: numbe
|
||||
Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
|
||||
tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'.
|
||||
tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ====
|
||||
@@ -148,4 +149,5 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
|
||||
var fp1: () =>any = a => 0;
|
||||
~~~
|
||||
!!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: T
|
||||
tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint 'abstract new (...args: any) => any'.
|
||||
Type 'Function' provides no match for the signature 'new (...args: any): any'.
|
||||
tests/cases/conformance/types/conditional/inferTypes1.ts(55,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/conditional/inferTypes1.ts(56,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'.
|
||||
Type 'Function' provides no match for the signature '(x: any): any'.
|
||||
tests/cases/conformance/types/conditional/inferTypes1.ts(82,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
|
||||
@@ -88,6 +89,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(153,40): error TS2322:
|
||||
type T24 = ArgumentType<(x: string, y: string) => number>; // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'.
|
||||
!!! error TS2344: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
type T25 = ArgumentType<Function>; // Error
|
||||
~~~~~~~~
|
||||
!!! error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
|
||||
tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'.
|
||||
Type '(n: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/inheritance.ts (2 errors) ====
|
||||
@@ -41,5 +42,6 @@ tests/cases/compiler/inheritance.ts(32,12): error TS2416: Property 'g' in type '
|
||||
~
|
||||
!!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'.
|
||||
!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2416: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
tests/cases/compiler/lambdaArgCrash.ts(27,25): error TS2304: Cannot find name 'ItemSet'.
|
||||
tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/lambdaArgCrash.ts (2 errors) ====
|
||||
@@ -36,6 +37,7 @@ tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '(
|
||||
super.add(listener);
|
||||
~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(items: ItemSet) => void' is not assignable to parameter of type '() => any'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ tests/cases/compiler/multipleInheritance.ts(18,21): error TS1174: Classes can on
|
||||
tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
|
||||
tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'.
|
||||
Type '(n: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/multipleInheritance.ts (4 errors) ====
|
||||
@@ -51,5 +52,6 @@ tests/cases/compiler/multipleInheritance.ts(36,12): error TS2416: Property 'g' i
|
||||
~
|
||||
!!! error TS2416: Property 'g' in type 'Baad' is not assignable to the same property in base type 'Good'.
|
||||
!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2416: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS
|
||||
tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'.
|
||||
Object literal may only specify known properties, and 'what' does not exist in type 'I2'.
|
||||
tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(11,6): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(12,6): error TS2322: Type '(s: string) => string' is not assignable to type '() => string'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2322: Type '(s: any) => any' is not assignable to type '() => string'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts (6 errors) ====
|
||||
@@ -33,9 +36,12 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error
|
||||
f2({ toString: (s) => s })
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
f2({ toString: (s: string) => s })
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '(s: string) => string' is not assignable to type '() => string'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
f2({ value: '', toString: (s) => s.uhhh })
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'.
|
||||
!!! error TS2322: Type '(s: any) => any' is not assignable to type '() => string'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
@@ -1,5 +1,7 @@
|
||||
tests/cases/compiler/parseTypes.ts(8,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'.
|
||||
Index signature for type 'number' is missing in type '(s: string) => void'.
|
||||
tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'.
|
||||
@@ -17,9 +19,11 @@ tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => voi
|
||||
y=g;
|
||||
~
|
||||
!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
x=g;
|
||||
~
|
||||
!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
w=g;
|
||||
~
|
||||
!!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(12,11): error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'.
|
||||
Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(13,11): error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'.
|
||||
Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts(14,11): error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'.
|
||||
Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionInferenceError.ts (3 errors) ====
|
||||
@@ -18,10 +21,13 @@ tests/cases/conformance/types/contextualTypes/partiallyAnnotatedFunction/partial
|
||||
testError((t1: D, t2, t3) => {})
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(t1: D, t2: any, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
testError((t1, t2: D, t3) => {})
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(t1: any, t2: D, t3: any) => void' is not assignable to parameter of type '(t: any, t1: any) => void'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
testError((t1, t2, t3: D) => {})
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(t1: any, t2: any, t3: D) => void' is not assignable to parameter of type '(t: any, t1: any) => void'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
|
||||
@@ -26,27 +26,35 @@ tests/cases/compiler/promisePermutations.ts(84,19): error TS2769: No overload ma
|
||||
tests/cases/compiler/promisePermutations.ts(88,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(91,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(92,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(93,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(97,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(100,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(101,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(102,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(106,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
@@ -68,18 +76,23 @@ tests/cases/compiler/promisePermutations.ts(111,19): error TS2769: No overload m
|
||||
tests/cases/compiler/promisePermutations.ts(117,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(120,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(121,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(122,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(126,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
@@ -88,12 +101,15 @@ tests/cases/compiler/promisePermutations.ts(129,33): error TS2769: No overload m
|
||||
tests/cases/compiler/promisePermutations.ts(132,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(133,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(134,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations.ts(137,33): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
@@ -258,6 +274,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here.
|
||||
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s5: Promise<string>;
|
||||
@@ -266,18 +283,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
@@ -287,6 +307,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here.
|
||||
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s6: Promise<string>;
|
||||
@@ -295,18 +316,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
@@ -353,6 +377,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here.
|
||||
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
|
||||
var s8: Promise<number>;
|
||||
@@ -361,18 +386,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
|
||||
|
||||
@@ -382,6 +410,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:13:5: The last overload is declared here.
|
||||
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
|
||||
@@ -400,18 +429,21 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here.
|
||||
var s9d = s9.then(sPromise, sPromise, sPromise); // ok
|
||||
var s9e = s9.then(nPromise, nPromise, nPromise); // ok
|
||||
|
||||
@@ -18,15 +18,23 @@ tests/cases/compiler/promisePermutations2.ts(83,19): error TS2345: Argument of t
|
||||
tests/cases/compiler/promisePermutations2.ts(87,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(90,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(91,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(92,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(96,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(99,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(100,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(101,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(105,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
@@ -48,20 +56,28 @@ tests/cases/compiler/promisePermutations2.ts(110,19): error TS2769: No overload
|
||||
tests/cases/compiler/promisePermutations2.ts(116,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(125,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(128,33): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/promisePermutations2.ts(131,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations2.ts(136,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
tests/cases/compiler/promisePermutations2.ts(143,35): error TS2769: No overload matches this call.
|
||||
@@ -203,18 +219,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here.
|
||||
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s5: Promise<string>;
|
||||
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
var r6: IPromise<string>;
|
||||
@@ -223,18 +243,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here.
|
||||
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s6: Promise<string>;
|
||||
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
var r7: IPromise<string>;
|
||||
@@ -280,18 +304,22 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here.
|
||||
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
|
||||
var s8: Promise<number>;
|
||||
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
|
||||
|
||||
var r9: IPromise<number>;
|
||||
@@ -300,6 +328,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations2.ts:12:5: The last overload is declared here.
|
||||
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
|
||||
@@ -316,12 +345,15 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of
|
||||
var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var s9d = s9.then(sPromise, sPromise, sPromise); // ok
|
||||
var s9e = s9.then(nPromise, nPromise, nPromise); // ok
|
||||
var s9f = s9.then(testFunction, sIPromise, nIPromise); // error
|
||||
|
||||
@@ -25,25 +25,33 @@ tests/cases/compiler/promisePermutations3.ts(83,19): error TS2769: No overload m
|
||||
Types of parameters 'x' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/promisePermutations3.ts(87,19): error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(90,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(91,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(92,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(96,19): error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(99,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(100,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(101,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(105,19): error TS2345: Argument of type '(cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
@@ -55,28 +63,36 @@ tests/cases/compiler/promisePermutations3.ts(110,19): error TS2345: Argument of
|
||||
Types of parameters 'cb' and 'value' are incompatible.
|
||||
Type 'string' is not assignable to type '<T>(a: T) => T'.
|
||||
tests/cases/compiler/promisePermutations3.ts(116,19): error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(119,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(120,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(121,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(128,33): error TS2345: Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
Type 'IPromise<string>' is not assignable to type 'IPromise<number>'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/promisePermutations3.ts(131,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(132,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(133,19): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/compiler/promisePermutations3.ts(136,33): error TS2769: No overload matches this call.
|
||||
The last overload gave the following error.
|
||||
Argument of type '(x: any) => IPromise<string>' is not assignable to parameter of type '(error: any) => IPromise<number>'.
|
||||
@@ -237,6 +253,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s5: Promise<string>;
|
||||
var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error
|
||||
@@ -244,18 +261,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: (a: string) => string) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
@@ -263,6 +283,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var s6: Promise<string>;
|
||||
var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error
|
||||
@@ -270,18 +291,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => IPromise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => Promise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: number, cb: <T>(a: T) => T) => Promise<string>' is not assignable to parameter of type '(value: string) => IPromise<string>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok
|
||||
|
||||
@@ -314,6 +338,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
|
||||
var s8: Promise<number>;
|
||||
var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error
|
||||
@@ -321,18 +346,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: (a: T) => T) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok
|
||||
|
||||
@@ -340,6 +368,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok
|
||||
var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok
|
||||
var r9d = r9.then(testFunction, sIPromise, nIPromise); // error
|
||||
@@ -354,18 +383,21 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => IPromise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => Promise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: The last overload gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(x: T, cb: <U>(a: U) => U) => Promise<T>' is not assignable to parameter of type '(value: number) => IPromise<any>'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here.
|
||||
var s9d = s9.then(sPromise, sPromise, sPromise); // ok
|
||||
var s9e = s9.then(nPromise, nPromise, nPromise); // ok
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'.
|
||||
Type '(a: number, b: any) => void' is not assignable to type '() => any'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 0.
|
||||
|
||||
|
||||
==== tests/cases/compiler/requiredInitializedParameter2.ts (1 errors) ====
|
||||
@@ -12,4 +13,5 @@ tests/cases/compiler/requiredInitializedParameter2.ts(6,5): error TS2416: Proper
|
||||
~~~~~~
|
||||
!!! error TS2416: Property 'method' in type 'C1' is not assignable to the same property in base type 'I1'.
|
||||
!!! error TS2416: Type '(a: number, b: any) => void' is not assignable to type '() => any'.
|
||||
!!! error TS2416: Target signature provides too few arguments. Expected 2 or more, but got 0.
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector<unknown, {}>'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts (1 errors) ====
|
||||
@@ -14,5 +15,6 @@ tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts(10,3): error
|
||||
editable: (state: any, props: any) => editable(), // expect "Type '(state: any, props: any) => {}' is not assignable to type 'Selector<unknown, {}>'", _not_ a circularity error
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '(state: any, props: any) => {}' is not assignable to type 'Selector<unknown, {}>'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS6500 tests/cases/compiler/reverseMappedTypeContextualTypeNotCircular.ts:10:3: The expected type comes from property 'editable' which is declared here on type '{ editable: Selector<unknown, {}>; }'
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/signatureLengthMismatchCall.ts(5,15): error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/compiler/signatureLengthMismatchCall.ts (1 errors) ====
|
||||
function takesCallback(fn: (a: number) => void) {
|
||||
// ...
|
||||
}
|
||||
|
||||
takesCallback((a: number, b: number) => {});
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(a: number, b: number) => void' is not assignable to parameter of type '(a: number) => void'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//// [signatureLengthMismatchCall.ts]
|
||||
function takesCallback(fn: (a: number) => void) {
|
||||
// ...
|
||||
}
|
||||
|
||||
takesCallback((a: number, b: number) => {});
|
||||
|
||||
|
||||
//// [signatureLengthMismatchCall.js]
|
||||
function takesCallback(fn) {
|
||||
// ...
|
||||
}
|
||||
takesCallback(function (a, b) { });
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/signatureLengthMismatchCall.ts ===
|
||||
function takesCallback(fn: (a: number) => void) {
|
||||
>takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchCall.ts, 0, 0))
|
||||
>fn : Symbol(fn, Decl(signatureLengthMismatchCall.ts, 0, 23))
|
||||
>a : Symbol(a, Decl(signatureLengthMismatchCall.ts, 0, 28))
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
takesCallback((a: number, b: number) => {});
|
||||
>takesCallback : Symbol(takesCallback, Decl(signatureLengthMismatchCall.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(signatureLengthMismatchCall.ts, 4, 15))
|
||||
>b : Symbol(b, Decl(signatureLengthMismatchCall.ts, 4, 25))
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/signatureLengthMismatchCall.ts ===
|
||||
function takesCallback(fn: (a: number) => void) {
|
||||
>takesCallback : (fn: (a: number) => void) => void
|
||||
>fn : (a: number) => void
|
||||
>a : number
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
takesCallback((a: number, b: number) => {});
|
||||
>takesCallback((a: number, b: number) => {}) : void
|
||||
>takesCallback : (fn: (a: number) => void) => void
|
||||
>(a: number, b: number) => {} : (a: number, b: number) => void
|
||||
>a : number
|
||||
>b : number
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
tests/cases/compiler/signatureLengthMismatchInOverload.ts(5,3): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error.
|
||||
Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error.
|
||||
Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/compiler/signatureLengthMismatchInOverload.ts (1 errors) ====
|
||||
function f(callback: (arg: string, arg2: string) => void): void;
|
||||
function f(callback: (arg: number) => void): void;
|
||||
function f(callback: unknown) { }
|
||||
|
||||
f((arg: number, arg2: number) => {});
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error.
|
||||
!!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'.
|
||||
!!! error TS2769: Types of parameters 'arg' and 'arg' are incompatible.
|
||||
!!! error TS2769: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2769: Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error.
|
||||
!!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'.
|
||||
!!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS2793 tests/cases/compiler/signatureLengthMismatchInOverload.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
//// [signatureLengthMismatchInOverload.ts]
|
||||
function f(callback: (arg: string, arg2: string) => void): void;
|
||||
function f(callback: (arg: number) => void): void;
|
||||
function f(callback: unknown) { }
|
||||
|
||||
f((arg: number, arg2: number) => {});
|
||||
|
||||
|
||||
//// [signatureLengthMismatchInOverload.js]
|
||||
function f(callback) { }
|
||||
f(function (arg, arg2) { });
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/signatureLengthMismatchInOverload.ts ===
|
||||
function f(callback: (arg: string, arg2: string) => void): void;
|
||||
>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50))
|
||||
>callback : Symbol(callback, Decl(signatureLengthMismatchInOverload.ts, 0, 11))
|
||||
>arg : Symbol(arg, Decl(signatureLengthMismatchInOverload.ts, 0, 22))
|
||||
>arg2 : Symbol(arg2, Decl(signatureLengthMismatchInOverload.ts, 0, 34))
|
||||
|
||||
function f(callback: (arg: number) => void): void;
|
||||
>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50))
|
||||
>callback : Symbol(callback, Decl(signatureLengthMismatchInOverload.ts, 1, 11))
|
||||
>arg : Symbol(arg, Decl(signatureLengthMismatchInOverload.ts, 1, 22))
|
||||
|
||||
function f(callback: unknown) { }
|
||||
>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50))
|
||||
>callback : Symbol(callback, Decl(signatureLengthMismatchInOverload.ts, 2, 11))
|
||||
|
||||
f((arg: number, arg2: number) => {});
|
||||
>f : Symbol(f, Decl(signatureLengthMismatchInOverload.ts, 0, 0), Decl(signatureLengthMismatchInOverload.ts, 0, 64), Decl(signatureLengthMismatchInOverload.ts, 1, 50))
|
||||
>arg : Symbol(arg, Decl(signatureLengthMismatchInOverload.ts, 4, 3))
|
||||
>arg2 : Symbol(arg2, Decl(signatureLengthMismatchInOverload.ts, 4, 15))
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/signatureLengthMismatchInOverload.ts ===
|
||||
function f(callback: (arg: string, arg2: string) => void): void;
|
||||
>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; }
|
||||
>callback : (arg: string, arg2: string) => void
|
||||
>arg : string
|
||||
>arg2 : string
|
||||
|
||||
function f(callback: (arg: number) => void): void;
|
||||
>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; }
|
||||
>callback : (arg: number) => void
|
||||
>arg : number
|
||||
|
||||
function f(callback: unknown) { }
|
||||
>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; }
|
||||
>callback : unknown
|
||||
|
||||
f((arg: number, arg2: number) => {});
|
||||
>f((arg: number, arg2: number) => {}) : void
|
||||
>f : { (callback: (arg: string, arg2: string) => void): void; (callback: (arg: number) => void): void; }
|
||||
>(arg: number, arg2: number) => {} : (arg: number, arg2: number) => void
|
||||
>arg : number
|
||||
>arg2 : number
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts(5,8): error TS2345: Argument of type '(n: number, m: string) => void' is not assignable to parameter of type '(n?: number) => void'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts (1 errors) ====
|
||||
function callee(n: number | undefined, m: string) { }
|
||||
|
||||
function caller(arg: (n?: number) => void) { }
|
||||
|
||||
caller(callee);
|
||||
~~~~~~
|
||||
!!! error TS2345: Argument of type '(n: number, m: string) => void' is not assignable to parameter of type '(n?: number) => void'.
|
||||
!!! error TS2345: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [signatureLengthMismatchWithOptionalParameters.ts]
|
||||
function callee(n: number | undefined, m: string) { }
|
||||
|
||||
function caller(arg: (n?: number) => void) { }
|
||||
|
||||
caller(callee);
|
||||
|
||||
|
||||
//// [signatureLengthMismatchWithOptionalParameters.js]
|
||||
function callee(n, m) { }
|
||||
function caller(arg) { }
|
||||
caller(callee);
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts ===
|
||||
function callee(n: number | undefined, m: string) { }
|
||||
>callee : Symbol(callee, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 0))
|
||||
>n : Symbol(n, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 16))
|
||||
>m : Symbol(m, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 38))
|
||||
|
||||
function caller(arg: (n?: number) => void) { }
|
||||
>caller : Symbol(caller, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 53))
|
||||
>arg : Symbol(arg, Decl(signatureLengthMismatchWithOptionalParameters.ts, 2, 16))
|
||||
>n : Symbol(n, Decl(signatureLengthMismatchWithOptionalParameters.ts, 2, 22))
|
||||
|
||||
caller(callee);
|
||||
>caller : Symbol(caller, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 53))
|
||||
>callee : Symbol(callee, Decl(signatureLengthMismatchWithOptionalParameters.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/signatureLengthMismatchWithOptionalParameters.ts ===
|
||||
function callee(n: number | undefined, m: string) { }
|
||||
>callee : (n: number | undefined, m: string) => void
|
||||
>n : number
|
||||
>m : string
|
||||
|
||||
function caller(arg: (n?: number) => void) { }
|
||||
>caller : (arg: (n?: number) => void) => void
|
||||
>arg : (n?: number) => void
|
||||
>n : number
|
||||
|
||||
caller(callee);
|
||||
>caller(callee) : void
|
||||
>caller : (arg: (n?: number) => void) => void
|
||||
>callee : (n: number, m: string) => void
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '(x: number) => number' is not assignable to type '() => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts (2 errors) ====
|
||||
@@ -30,6 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type '(x: number) => number' is not assignable to type '() => number'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: (x: number) => number; // error, too many required params
|
||||
}
|
||||
|
||||
@@ -64,6 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: (x: number, y: number) => number; // error, too many required params
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -1,9 +1,11 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new (x: number) => number' is not assignable to type 'new () => number'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts (2 errors) ====
|
||||
@@ -30,6 +32,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: number) => number' is not assignable to type 'new () => number'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: new (x: number) => number; // error, too many required params
|
||||
}
|
||||
|
||||
@@ -64,6 +67,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: new (x: number, y: number) => number; // error, too many required params
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -1,9 +1,11 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base<T>'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base<T>'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a()' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
@@ -15,6 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
@@ -50,6 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x: T, y: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a4(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
@@ -97,9 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '<T>(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '<T>(x: T, y: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts (22 errors) ====
|
||||
@@ -127,6 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base<T>'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: (x: T) => T; // error, too many required params
|
||||
}
|
||||
|
||||
@@ -161,6 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base<T>'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: (x: T, y: T) => T; // error, too many required params
|
||||
}
|
||||
|
||||
@@ -235,6 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -313,6 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: (x: T, y: T) => T;
|
||||
}
|
||||
|
||||
@@ -435,6 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type '<T>(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: <T>(x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T
|
||||
}
|
||||
|
||||
@@ -469,6 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type '<T>(x: T, y: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: <T>(x: T, y: T) => T; // error, too many required params
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -1,9 +1,11 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base<T>'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new () => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base<T>'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a()' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
@@ -15,6 +17,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a2(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
@@ -50,6 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a4(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
@@ -97,9 +101,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new <T>(x: T) => T' is not assignable to type 'new <T>() => T'.
|
||||
Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new <T>(x: T, y: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (22 errors) ====
|
||||
@@ -127,6 +133,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base<T>'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: new (x: T) => T; // error, too many required params
|
||||
}
|
||||
|
||||
@@ -161,6 +168,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base<T>'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: new (x: T, y: T) => T; // error, too many required params
|
||||
}
|
||||
|
||||
@@ -235,6 +243,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>() => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -313,6 +322,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: new (x: T, y: T) => T;
|
||||
}
|
||||
|
||||
@@ -435,6 +445,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'new <T>(x: T) => T' is not assignable to type 'new <T>() => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 1 or more, but got 0.
|
||||
a: new <T>(x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T
|
||||
}
|
||||
|
||||
@@ -469,6 +480,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: Types of property 'a3' are incompatible.
|
||||
!!! error TS2430: Type 'new <T>(x: T, y: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
!!! error TS2430: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
a3: new <T>(x: T, y: T) => T; // error, too many required params
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/jsx/file.tsx(8,15): error TS2322: Type 'T & { "ignore-pr
|
||||
tests/cases/conformance/jsx/file.tsx(13,15): error TS2322: Type 'T' is not assignable to type 'IntrinsicAttributes & { prop: unknown; "ignore-prop": string; }'.
|
||||
Type 'T' is not assignable to type '{ prop: unknown; "ignore-prop": string; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'.
|
||||
Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'.
|
||||
Types of parameters 'val' and 'selectedVal' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
@@ -43,6 +44,7 @@ tests/cases/conformance/jsx/file.tsx(31,52): error TS2322: Type '(val: string) =
|
||||
let o = <Link func={func} />
|
||||
~~~~
|
||||
!!! error TS2322: Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1.
|
||||
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:16:30: The expected type comes from property 'func' which is declared here on type 'IntrinsicAttributes & { func: (arg: number) => void; }'
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(84,1):
|
||||
Type predicate 'p2 is A' is not assignable to 'p1 is A'.
|
||||
Parameter 'p2' is not in the same position as parameter 'p1'.
|
||||
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(90,1): error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'.
|
||||
Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,9): error TS2749: 'b' refers to a value, but is being used as a type here. Did you mean 'typeof b'?
|
||||
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,11): error TS1005: ',' expected.
|
||||
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(95,14): error TS1005: ',' expected.
|
||||
@@ -211,6 +212,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54
|
||||
assign3 = function(p1, p2, p3): p1 is A {
|
||||
~~~~~~~
|
||||
!!! error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'.
|
||||
!!! error TS2322: Target signature provides too few arguments. Expected 3 or more, but got 2.
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
function takesCallback(fn: (a: number) => void) {
|
||||
// ...
|
||||
}
|
||||
|
||||
takesCallback((a: number, b: number) => {});
|
||||
@@ -0,0 +1,5 @@
|
||||
function f(callback: (arg: string, arg2: string) => void): void;
|
||||
function f(callback: (arg: number) => void): void;
|
||||
function f(callback: unknown) { }
|
||||
|
||||
f((arg: number, arg2: number) => {});
|
||||
@@ -0,0 +1,5 @@
|
||||
function callee(n: number | undefined, m: string) { }
|
||||
|
||||
function caller(arg: (n?: number) => void) { }
|
||||
|
||||
caller(callee);
|
||||
Reference in New Issue
Block a user