Accept baselines

This commit is contained in:
Nathan Shively-Sanders
2015-11-24 09:37:12 -08:00
parent c35f7da0fa
commit 772f8dd26d
151 changed files with 1874 additions and 992 deletions
@@ -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'.
Signature '(): string' has no corresponding signature in '(key: string) => string'
==== 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: Signature '(): string' has no corresponding signature in '(key: string) => string'
f(key: string): string;
}
@@ -29,13 +29,15 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(24,5): error
tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(25,5): error TS2322: Type '[string, number]' is not assignable to type '[string]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => string'.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => string | number'
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(26,5): error TS2322: Type 'StrNum' is not assignable to type '[string]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => string'.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => string | number'
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(27,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string]'.
Property 'length' is missing in type '{ 0: string; 1: number; }'.
tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(28,5): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'.
@@ -120,15 +122,17 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(30,5): error
!!! error TS2322: Type '[string, number]' is not assignable to type '[string]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'.
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => string | number'
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var m2: [string] = y;
~~
!!! error TS2322: Type 'StrNum' is not assignable to type '[string]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'.
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => string | number'
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var m3: [string] = z;
~~
!!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string]'.
@@ -1,8 +1,9 @@
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
Types of property 'pop' are incompatible.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => number | string'
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
Property '0' is missing in type 'number[]'.
@@ -20,8 +21,9 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte
!!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string'
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
// In a contextually typed array literal expression containing one or more spread elements,
// an element expression at index N is contextually typed by the numeric index type of the contextual type, if any.
@@ -6,8 +6,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
Types of property 'pop' are incompatible.
Type '() => number | string | boolean' is not assignable to type '() => number'.
Type 'number | string | boolean' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => number | string | boolean'
Type 'number | string | boolean' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'.
Property '0' is missing in type '(number[] | string[])[]'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
@@ -15,10 +16,11 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'.
Types of property 'push' are incompatible.
Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'.
Types of parameters 'items' and 'items' are incompatible.
Type 'number | string' is not assignable to type 'Number'.
Type 'string' is not assignable to type 'Number'.
Property 'toFixed' is missing in type 'String'.
Signature '(...items: Number[]): number' has no corresponding signature in '(...items: (number | string)[]) => number'
Types of parameters 'items' and 'items' are incompatible.
Type 'number | string' is not assignable to type 'Number'.
Type 'string' is not assignable to type 'Number'.
Property 'toFixed' is missing in type 'String'.
==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (6 errors) ====
@@ -50,8 +52,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
!!! error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string | boolean'
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
// The resulting type an array literal expression is determined as follows:
// - the resulting type is an array type with an element type that is the union of the types of the
@@ -79,8 +82,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
!!! error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'.
!!! error TS2322: Types of property 'push' are incompatible.
!!! error TS2322: Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'.
!!! error TS2322: Types of parameters 'items' and 'items' are incompatible.
!!! error TS2322: Type 'number | string' is not assignable to type 'Number'.
!!! error TS2322: Type 'string' is not assignable to type 'Number'.
!!! error TS2322: Property 'toFixed' is missing in type 'String'.
!!! error TS2322: Signature '(...items: Number[]): number' has no corresponding signature in '(...items: (number | string)[]) => number'
!!! error TS2322: Types of parameters 'items' and 'items' are incompatible.
!!! error TS2322: Type 'number | string' is not assignable to type 'Number'.
!!! error TS2322: Type 'string' is not assignable to type 'Number'.
!!! error TS2322: Property 'toFixed' is missing in type 'String'.
@@ -1,5 +1,6 @@
tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts(2,9): error TS2352: Neither type '(v: number) => number' nor type '(x: number) => string' is assignable to the other.
Type 'number' is not assignable to type 'string'.
Signature '(x: number): string' has no corresponding signature in '(v: number) => number'
Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts (1 errors) ====
@@ -7,4 +8,5 @@ tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts(2,9):
var x = (v => v) as (x: number) => string;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Neither type '(v: number) => number' nor type '(x: number) => string' is assignable to the other.
!!! error TS2352: Type 'number' is not assignable to type 'string'.
!!! error TS2352: Signature '(x: number): string' has no corresponding signature in '(v: number) => number'
!!! error TS2352: Type 'number' is not assignable to type 'string'.
@@ -1,7 +1,8 @@
tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(14,1): error TS2322: Type 'NotBoolean' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => Object' is not assignable to type '() => boolean'.
Type 'Object' is not assignable to type 'boolean'.
Signature '(): boolean' has no corresponding signature in '() => Object'
Type 'Object' is not assignable to type 'boolean'.
tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'.
@@ -25,7 +26,8 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(
!!! error TS2322: Type 'NotBoolean' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => Object'
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
b = a;
b = x;
@@ -1,4 +1,5 @@
tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'.
Signature '(n: number): boolean' has no corresponding signature in 'String'
==== tests/cases/compiler/assignToFn.ts (1 errors) ====
@@ -12,5 +13,6 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assi
x.f="hello";
~~~
!!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'.
!!! error TS2322: Signature '(n: number): boolean' has no corresponding signature in 'String'
}
@@ -1,8 +1,9 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
Types of property 'pop' are incompatible.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => number | string'
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'.
Property '0' is missing in type '{}[]'.
@@ -29,8 +30,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '() => number | string'
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
emptyObjTuple = emptyObjArray;
~~~~~~~~~~~~~
!!! error TS2322: Type '{}[]' is not assignable to type '[{}]'.
@@ -3,10 +3,12 @@ tests/cases/compiler/assignmentCompatBug5.ts(2,8): error TS2345: Argument of typ
tests/cases/compiler/assignmentCompatBug5.ts(5,6): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'number[]'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatBug5.ts(8,6): error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'.
Types of parameters 's' and 'n' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(n: number): number' has no corresponding signature in '(s: string) => void'
Types of parameters 's' and 'n' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatBug5.ts(9,6): error TS2345: Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'.
Type 'void' is not assignable to type 'number'.
Signature '(n: number): number' has no corresponding signature in '(n: number) => void'
Type 'void' is not assignable to type 'number'.
==== tests/cases/compiler/assignmentCompatBug5.ts (4 errors) ====
@@ -26,11 +28,13 @@ tests/cases/compiler/assignmentCompatBug5.ts(9,6): error TS2345: Argument of typ
foo3((s:string) => { });
~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(s: string) => void' is not assignable to parameter of type '(n: number) => number'.
!!! error TS2345: Types of parameters 's' and 'n' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2345: Signature '(n: number): number' has no corresponding signature in '(s: string) => void'
!!! error TS2345: Types of parameters 's' and 'n' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
foo3((n) => { return; });
~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(n: number) => void' is not assignable to parameter of type '(n: number) => number'.
!!! error TS2345: Type 'void' is not assignable to type 'number'.
!!! error TS2345: Signature '(n: number): number' has no corresponding signature in '(n: number) => void'
!!! error TS2345: Type 'void' is not assignable to type 'number'.
@@ -1,27 +1,35 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in 'S2'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => number'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => string'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in 'S2'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => number'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => string'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts (8 errors) ====
@@ -62,41 +70,49 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
t = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'T'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in 'S2'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
t = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => number'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
t = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => string'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in 'S2'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => number'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => string'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -9,13 +9,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
@@ -23,13 +25,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'.
@@ -95,15 +99,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'S2' is not assignable to type 'T'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
t = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
@@ -117,15 +123,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'.
@@ -1,13 +1,16 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
Signature '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ====
@@ -65,17 +68,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a8 = b8; // error, { foo: number } and Base are incompatible
~~
!!! error TS2322: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2322: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
b8 = a8; // error, { foo: number } and Base are incompatible
~~
!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
!!! error TS2322: Signature '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
var b10: <T extends Derived>(...x: T[]) => T;
@@ -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'.
Signature '(): number' has no corresponding signature in '(x: number) => number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'.
Signature '(): number' has no corresponding signature in '(x: number) => number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'.
Signature '(): number' has no corresponding signature in '(x: number, y?: number) => number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'.
Signature '(): number' has no corresponding signature in '(x: number, y: number) => number'
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'.
Signature '(x?: number): number' has no corresponding signature in '(x: number, y: number) => number'
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'.
Signature '(x: number): number' has no corresponding signature in '(x: number, y: number) => number'
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'.
Signature '(x: number): number' has no corresponding signature in '(x: number, y: number) => number'
==== 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: Signature '(): number' has no corresponding signature in '(x: number) => number'
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: Signature '(): number' has no corresponding signature in '(x: number) => number'
a = b.a4; // error
~
!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '(x: number, y?: number) => number'
a = b.a5; // ok
a = b.a6; // error
~
!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '(x: number, y: number) => number'
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: Signature '(x?: number): number' has no corresponding signature in '(x: number, y: number) => number'
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: Signature '(x: number): number' has no corresponding signature in '(x: number, y: number) => number'
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: Signature '(x: number): number' has no corresponding signature in '(x: number, y: number) => number'
var a4: (x: number, y?: number) => number;
a4 = () => 1; // ok, fewer required params
@@ -1,30 +1,39 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'.
Types of parameters 'args' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(...args: number[]): number' has no corresponding signature in '(...args: string[]) => number'
Types of parameters 'args' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'.
Types of parameters 'x' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(...args: number[]): number' has no corresponding signature in '(x?: string) => number'
Types of parameters 'x' and 'args' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'.
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number'
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number, z?: number) => number'
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'z' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: number[]) => number'
Types of parameters 'z' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: string, y?: string, z?: string) => number'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x?: number, y?: number) => number'
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number) => number'
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number'
Types of parameters 'args' and 'z' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts (9 errors) ====
@@ -43,16 +52,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a = (...args: string[]) => 1; // error, type mismatch
~
!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'.
!!! error TS2322: Types of parameters 'args' and 'args' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(...args: number[]): number' has no corresponding signature in '(...args: string[]) => number'
!!! error TS2322: Types of parameters 'args' and 'args' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = (x?: number) => 1; // ok, same number of required params
a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params
a = (x: number) => 1; // ok, rest param corresponds to infinite number of params
a = (x?: string) => 1; // error, incompatible type
~
!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'.
!!! error TS2322: Types of parameters 'x' and 'args' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(...args: number[]): number' has no corresponding signature in '(x?: string) => number'
!!! error TS2322: Types of parameters 'x' and 'args' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var a2: (x: number, ...z: number[]) => number;
@@ -64,8 +75,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error
~~
!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number'
!!! error TS2322: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params
a2 = (x: number, y?: number) => 1; // ok, same number of required params
@@ -77,35 +89,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a3 = (x: number, y?: number, z?: number) => 1; // error
~~
!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number, z?: number) => number'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
a3 = (x: number, ...z: number[]) => 1; // error
~~
!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'z' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...z: number[]) => number'
!!! error TS2322: Types of parameters 'z' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
a3 = (x: string, y?: string, z?: string) => 1; // error
~~
!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: string, y?: string, z?: string) => number'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var a4: (x?: number, y?: string, ...z: number[]) => number;
a4 = () => 1; // ok, fewer required params
a4 = (x?: number, y?: number) => 1; // error, type mismatch
~~
!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x?: number, y?: number) => number'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
a4 = (x: number) => 1; // ok, all present params match
a4 = (x: number, y?: number) => 1; // error, second param has type mismatch
~~
!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, y?: number) => number'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types
a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch
~~
!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'.
!!! error TS2322: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x?: number, y?: string, ...z: number[]): number' has no corresponding signature in '(x: number, ...args: string[]) => number'
!!! error TS2322: Types of parameters 'args' and 'z' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -1,11 +1,19 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2322: Type 'S2' is not assignable to type 'T'.
Signature 'new (x: number): void' has no corresponding signature in 'S2'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in 'S2'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string'
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ====
@@ -39,25 +47,33 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
t = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'T'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in 'S2'
t = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number'
t = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string'
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in 'S2'
a = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => number'
a = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => string'
@@ -9,9 +9,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
@@ -19,9 +21,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'.
@@ -79,11 +83,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'S2' is not assignable to type 'T'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
t = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
@@ -97,11 +103,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
a = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in '(x: string) => void'
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'.
@@ -1,25 +1,34 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
Signature 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'.
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
Signature 'new (x: { new (a: number): number; new (a?: number): number; }): number[]' has no corresponding signature in 'new <T>(x: (a: T) => T) => T[]'
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
Signature 'new (a: number): number' has no corresponding signature in '(a: any) => any'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]'.
Types of parameters 'x' and 'x' are incompatible.
Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
Signature 'new <T>(x: (a: T) => T): T[]' has no corresponding signature in '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'
Types of parameters 'x' and 'x' are incompatible.
Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'.
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
Signature 'new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]' has no corresponding signature in 'new <T>(x: (a: T) => T) => any[]'
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
Signature 'new <T extends Derived>(a: T): T' has no corresponding signature in '(a: any) => any'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]'.
Types of parameters 'x' and 'x' are incompatible.
Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
Signature 'new <T>(x: (a: T) => T): any[]' has no corresponding signature in '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'
Types of parameters 'x' and 'x' are incompatible.
Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (6 errors) ====
@@ -77,17 +86,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a8 = b8; // error, type mismatch
~~
!!! error TS2322: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2322: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
b8 = a8; // error
~~
!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
!!! error TS2322: Signature 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U): (r: T) => U' has no corresponding signature in 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'.
var b10: new <T extends Derived>(...x: T[]) => T;
@@ -114,25 +126,31 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
a16 = b16; // error
~~~
!!! error TS2322: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
!!! error TS2322: Signature 'new (x: { new (a: number): number; new (a?: number): number; }): number[]' has no corresponding signature in 'new <T>(x: (a: T) => T) => T[]'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
!!! error TS2322: Signature 'new (a: number): number' has no corresponding signature in '(a: any) => any'
b16 = a16; // error
~~~
!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
!!! error TS2322: Signature 'new <T>(x: (a: T) => T): T[]' has no corresponding signature in '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
var b17: new <T>(x: (a: T) => T) => any[];
a17 = b17; // error
~~~
!!! error TS2322: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
!!! error TS2322: Signature 'new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]' has no corresponding signature in 'new <T>(x: (a: T) => T) => any[]'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
!!! error TS2322: Signature 'new <T extends Derived>(a: T): T' has no corresponding signature in '(a: any) => any'
b17 = a17; // error
~~~
!!! error TS2322: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
!!! error TS2322: Signature 'new <T>(x: (a: T) => T): any[]' has no corresponding signature in '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
}
module WithGenericSignaturesInBaseType {
@@ -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'.
Signature 'new (): number' has no corresponding signature in 'new (x: number) => number'
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'.
Signature 'new (): number' has no corresponding signature in 'new (x: number, y?: number) => number'
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'.
Signature 'new (): number' has no corresponding signature in 'new (x: number, y: number) => number'
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'.
Signature 'new (x?: number): number' has no corresponding signature in 'new (x: number, y: number) => number'
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'.
Signature 'new (x: number): number' has no corresponding signature in 'new (x: number, y: number) => number'
==== 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: Signature 'new (): number' has no corresponding signature in 'new (x: number) => number'
a = b.a4; // error
~
!!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'.
!!! error TS2322: Signature 'new (): number' has no corresponding signature in 'new (x: number, y?: number) => number'
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: Signature 'new (): number' has no corresponding signature in 'new (x: number, y: number) => number'
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: Signature 'new (x?: number): number' has no corresponding signature in 'new (x: number, y: number) => number'
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: Signature 'new (x: number): number' has no corresponding signature in 'new (x: number, y: number) => number'
var a4: new (x: number, y?: number) => number;
a4 = b.a; // ok
@@ -1,9 +1,15 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
Signature '(): T' has no corresponding signature in '(x: T) => any'
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'.
Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => any'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
Signature '<T>(): T' has no corresponding signature in '(x: T) => T'
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'.
Signature '<T>(): T' has no corresponding signature in '(x: T, y?: T) => 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'.
Signature '<T>(): T' has no corresponding signature in '<T>(x: T) => any'
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'.
Signature '<T>(x: T): T' has no corresponding signature in '<T>(x: T, y: T) => any'
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ====
@@ -23,6 +29,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: Signature '(): T' has no corresponding signature in '(x: T) => any'
this.a2 = () => null; // ok, same T of required params
this.a2 = (x?: T) => null; // ok, same T of required params
@@ -34,6 +41,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: Signature '(x: T): T' has no corresponding signature in '(x: T, y: T) => any'
this.a4 = () => null; // ok, fewer required params
this.a4 = (x?: T, y?: T) => null; // ok, fewer required params
@@ -78,9 +86,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: Signature '<T>(): T' has no corresponding signature in '(x: T) => T'
b.a = t.a4;
~~~
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>() => T'.
!!! error TS2322: Signature '<T>(): T' has no corresponding signature in '(x: T, y?: T) => T'
b.a = t.a5;
b.a2 = t.a;
@@ -124,6 +134,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: Signature '<T>(): T' has no corresponding signature in '<T>(x: T) => any'
this.a2 = <T>() => null; // ok, same T of required params
this.a2 = <T>(x?: T) => null; // ok, same T of required params
@@ -135,6 +146,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: Signature '<T>(x: T): T' has no corresponding signature in '<T>(x: T, y: T) => any'
this.a4 = <T>() => null; // ok, fewer required params
this.a4 = <T>(x?: T, y?: T) => null; // ok, fewer required params
@@ -1,13 +1,17 @@
tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'.
Types of parameters 'x' and 's1' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Signature '(s1: string): number' has no corresponding signature in '(x: string) => string'
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'.
Signature '(s1: string): number' has no corresponding signature in '(x: number) => number'
Types of parameters 'x' and 's1' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'.
Signature '(s1: string): number' has no corresponding signature in '{ (x: string): string; (x: number): number; }'
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'.
Signature 'new (x: number): void' has no corresponding signature in 'typeof C'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/assignmentCompatWithOverloads.ts (4 errors) ====
@@ -30,18 +34,21 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type
g = f2; // Error
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(s1: string): number' has no corresponding signature in '(x: string) => string'
!!! error TS2322: Type 'string' is not assignable to type 'number'.
g = f3; // Error
~
!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'.
!!! error TS2322: Types of parameters 'x' and 's1' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(s1: string): number' has no corresponding signature in '(x: number) => number'
!!! error TS2322: Types of parameters 'x' and 's1' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
g = f4; // Error
~
!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(s1: string): number' has no corresponding signature in '{ (x: string): string; (x: number): number; }'
!!! error TS2322: Type 'string' is not assignable to type 'number'.
class C {
constructor(x: string);
@@ -53,5 +60,6 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type
d = C; // Error
~
!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature 'new (x: number): void' has no corresponding signature in 'typeof C'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
Signature '<Tstring>(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Signature '<Tstring>(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
Signature '<Tstring>(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Signature '<Tstring>(a: Tstring): Tstring' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
Signature '<Tnumber>(a: Tnumber): Tnumber' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
!!! error TS2322: Signature '<Tnumber>(a: Tnumber): Tnumber' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
Signature 'new <Tnumber>(param: Tnumber): any' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
!!! error TS2322: Signature 'new <Tnumber>(param: Tnumber): any' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
Signature 'new <Tstring>(param: Tstring): any' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
!!! error TS2322: Signature 'new <Tstring>(param: Tstring): any' has no corresponding signature in 'interfaceWithPublicAndOptional<number, string>'
@@ -1,6 +1,7 @@
tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type 'number' is not assignable to type '() => string'.
Signature '(): string' has no corresponding signature in 'Number'
==== tests/cases/compiler/assignmentToObject.ts (1 errors) ====
@@ -11,4 +12,5 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString:
!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '() => string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in 'Number'
@@ -1,11 +1,13 @@
tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type 'number' is not assignable to type '() => string'.
Signature '(): string' has no corresponding signature in 'Number'
tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'.
Property 'apply' is missing in type '{}'.
tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'.
Types of property 'apply' are incompatible.
Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'.
Signature '(thisArg: any, argArray?: any): any' has no corresponding signature in 'Number'
==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ====
@@ -14,6 +16,7 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type
!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '() => string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in 'Number'
var goodObj: Object = {
toString(x?) {
return "";
@@ -48,4 +51,5 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type
~~~~~~~~~~
!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function'.
!!! error TS2322: Types of property 'apply' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'.
!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'.
!!! error TS2322: Signature '(thisArg: any, argArray?: any): any' has no corresponding signature in 'Number'
@@ -3,10 +3,12 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1
tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(8,16): error TS1055: Type 'number' is not a valid async function return type.
tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(9,16): error TS1055: Type 'PromiseLike' is not a valid async function return type.
tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(10,16): error TS1055: Type 'typeof Thenable' is not a valid async function return type.
Type 'Thenable' is not assignable to type 'PromiseLike<any>'.
Types of property 'then' are incompatible.
Type '() => void' is not assignable to type '{ <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>; <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>; }'.
Type 'void' is not assignable to type 'PromiseLike<any>'.
Signature 'new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): PromiseLike<T>' has no corresponding signature in 'typeof Thenable'
Type 'Thenable' is not assignable to type 'PromiseLike<any>'.
Types of property 'then' are incompatible.
Type '() => void' is not assignable to type '{ <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>; <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>; }'.
Signature '<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'PromiseLike<any>'.
tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(17,16): error TS1059: Return expression in async function does not have a valid callable 'then' member.
tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts(23,25): error TS1058: Operand for 'await' does not have a valid callable 'then' member.
@@ -32,10 +34,12 @@ tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1
async function fn6(): Thenable { } // error
~~~
!!! error TS1055: Type 'typeof Thenable' is not a valid async function return type.
!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike<any>'.
!!! error TS1055: Types of property 'then' are incompatible.
!!! error TS1055: Type '() => void' is not assignable to type '{ <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>; <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>; }'.
!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike<any>'.
!!! error TS1055: Signature 'new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): PromiseLike<T>' has no corresponding signature in 'typeof Thenable'
!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike<any>'.
!!! error TS1055: Types of property 'then' are incompatible.
!!! error TS1055: Type '() => void' is not assignable to type '{ <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>; <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>; }'.
!!! error TS1055: Signature '<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>' has no corresponding signature in '() => void'
!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike<any>'.
async function fn7() { return; } // valid: Promise<void>
async function fn8() { return 1; } // valid: Promise<number>
async function fn9() { return null; } // valid: Promise<any>
@@ -1,15 +1,18 @@
tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => number' is not assignable to type '() => boolean'.
Type 'number' is not assignable to type 'boolean'.
Signature '(): boolean' has no corresponding signature in '() => number'
Type 'number' is not assignable to type 'boolean'.
tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => string' is not assignable to type '() => boolean'.
Type 'string' is not assignable to type 'boolean'.
Signature '(): boolean' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'boolean'.
tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'.
Types of property 'valueOf' are incompatible.
Type '() => Object' is not assignable to type '() => boolean'.
Type 'Object' is not assignable to type 'boolean'.
Signature '(): boolean' has no corresponding signature in '() => Object'
Type 'Object' is not assignable to type 'boolean'.
==== tests/cases/compiler/booleanAssignment.ts (3 errors) ====
@@ -19,19 +22,22 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a
!!! error TS2322: Type 'number' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => number' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => number'
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
b = "a"; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => string' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => string'
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
b = {}; // Error
~
!!! error TS2322: Type '{}' is not assignable to type 'Boolean'.
!!! error TS2322: Types of property 'valueOf' are incompatible.
!!! error TS2322: Type '() => Object' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => Object'
!!! error TS2322: Type 'Object' is not assignable to type 'boolean'.
var o = {};
o = b; // OK
@@ -1,5 +1,7 @@
tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2322: Type 'new () => any' is not assignable to type '() => void'.
Signature '(): void' has no corresponding signature in 'new () => any'
tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => void' is not assignable to type 'new () => any'.
Signature 'new (): any' has no corresponding signature in '() => void'
==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ====
@@ -12,6 +14,8 @@ tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() =>
foo = bar; // error
~~~
!!! error TS2322: Type 'new () => any' is not assignable to type '() => void'.
!!! error TS2322: Signature '(): void' has no corresponding signature in 'new () => any'
bar = foo; // error
~~~
!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'.
!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in '() => void'
@@ -1,7 +1,8 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
Types of property 'a' are incompatible.
Type '(x: number) => string' is not assignable to type '(x: number) => number'.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): number' has no corresponding signature in '(x: number) => string'
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts (1 errors) ====
@@ -66,7 +67,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type '(x: number) => string' is not assignable to type '(x: number) => number'.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
!!! error TS2430: Signature '(x: number): number' has no corresponding signature in '(x: number) => string'
!!! error TS2430: Type 'string' is not assignable to type 'number'.
// N's
a: (x: number) => string; // error because base returns non-void;
}
@@ -1,17 +1,20 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
Types of property 'a2' are incompatible.
Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'.
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
Signature '(x: number): string[]' has no corresponding signature in '(x: T) => U[]'
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'.
Types of property 'a8' are incompatible.
Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ====
@@ -70,8 +73,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
!!! error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a2' are incompatible.
!!! error TS2430: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'.
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430: Type 'T' is not assignable to type 'number'.
!!! error TS2430: Signature '(x: number): string[]' has no corresponding signature in '(x: T) => U[]'
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430: Type 'T' is not assignable to type 'number'.
a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic
}
@@ -85,12 +89,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a8' are incompatible.
!!! error TS2430: Type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2430: Types of property 'foo' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
!!! error TS2430: Signature '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2430: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2430: Types of property 'foo' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
}
@@ -13,8 +13,9 @@ tests/cases/conformance/types/tuple/castingTuple.ts(30,5): error TS2403: Subsequ
tests/cases/conformance/types/tuple/castingTuple.ts(30,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other.
Types of property 'pop' are incompatible.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => number | string'
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot find name 't4'.
@@ -70,8 +71,9 @@ tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot
!!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other.
!!! error TS2352: Types of property 'pop' are incompatible.
!!! error TS2352: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2352: Type 'number | string' is not assignable to type 'number'.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
!!! error TS2352: Signature '(): number' has no corresponding signature in '() => number | string'
!!! error TS2352: Type 'number | string' is not assignable to type 'number'.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
t4[2] = 10;
~~
!!! error TS2304: Cannot find name 't4'.
@@ -1,6 +1,7 @@
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts(19,59): error TS2345: Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'.
Type 'B' is not assignable to type 'C'.
Property 'z' is missing in type 'B'.
Signature '(x: C): C' has no corresponding signature in '(c: C) => B'
Type 'B' is not assignable to type 'C'.
Property 'z' is missing in type 'B'.
==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ====
@@ -25,5 +26,6 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete
(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A);
~~~~~~~~~~
!!! error TS2345: Argument of type '(c: C) => B' is not assignable to parameter of type '(x: C) => C'.
!!! error TS2345: Type 'B' is not assignable to type 'C'.
!!! error TS2345: Property 'z' is missing in type 'B'.
!!! error TS2345: Signature '(x: C): C' has no corresponding signature in '(c: C) => B'
!!! error TS2345: Type 'B' is not assignable to type 'C'.
!!! error TS2345: Property 'z' is missing in type 'B'.
@@ -1,7 +1,9 @@
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(7,43): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'.
Type 'T' is not assignable to type 'S'.
Signature '(x: S): S' has no corresponding signature in '(ss: S) => T'
Type 'T' is not assignable to type 'S'.
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,29): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'.
Type 'T' is not assignable to type 'S'.
Signature '(x: S): S' has no corresponding signature in '(ss: S) => T'
Type 'T' is not assignable to type 'S'.
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type 'string' is not assignable to type 'number'.
@@ -17,13 +19,15 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete
(new Chain(t)).then(tt => s).then(ss => t);
~~~~~~~
!!! error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'.
!!! error TS2345: Type 'T' is not assignable to type 'S'.
!!! error TS2345: Signature '(x: S): S' has no corresponding signature in '(ss: S) => T'
!!! error TS2345: Type 'T' is not assignable to type 'S'.
// But error to try to climb up the chain
(new Chain(s)).then(ss => t);
~~~~~~~
!!! error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'.
!!! error TS2345: Type 'T' is not assignable to type 'S'.
!!! error TS2345: Signature '(x: S): S' has no corresponding signature in '(ss: S) => T'
!!! error TS2345: Type 'T' is not assignable to type 'S'.
// Staying at T or S should be fine
(new Chain(t)).then(tt => t).then(tt => t).then(tt => t);
@@ -1,6 +1,7 @@
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(7,1): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type 'string' is not assignable to type 'new () => A'.
Signature 'new (): A' has no corresponding signature in 'String'
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts (2 errors) ====
@@ -16,4 +17,5 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
!!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type.
AAA = "asdf";
~~~
!!! error TS2322: Type 'string' is not assignable to type 'new () => A'.
!!! error TS2322: Type 'string' is not assignable to type 'new () => A'.
!!! error TS2322: Signature 'new (): A' has no corresponding signature in 'String'
@@ -1,5 +1,7 @@
tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
Signature 'new (x: string): A' has no corresponding signature in 'typeof B'
tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'.
Signature 'new (x: string): A' has no corresponding signature in 'typeof B'
==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ====
@@ -21,7 +23,9 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof
var r1: typeof A = B; // error
~~
!!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'.
!!! error TS2322: Signature 'new (x: string): A' has no corresponding signature in 'typeof B'
var r2: new (x: string) => A = B; // error
~~
!!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'.
!!! error TS2322: Signature 'new (x: string): A' has no corresponding signature in 'typeof B'
var r3: typeof A = C; // ok
@@ -6,13 +6,16 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou
Property 'propertyB' is missing in type 'A'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'.
Type '(n: X) => string' is not assignable to type '(t: X) => number'.
Type 'string' is not assignable to type 'number'.
Signature '(t: X): number' has no corresponding signature in '(n: X) => string'
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'.
Type '(m: X) => number' is not assignable to type '(t: X) => string'.
Type 'number' is not assignable to type 'string'.
Signature '(t: X): string' has no corresponding signature in '(m: X) => number'
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(21,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'.
Type '(m: X) => number' is not assignable to type '(t: X) => boolean'.
Type 'number' is not assignable to type 'boolean'.
Signature '(t: X): boolean' has no corresponding signature in '(m: X) => number'
Type 'number' is not assignable to type 'boolean'.
==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts (5 errors) ====
@@ -46,16 +49,19 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou
~~~~~~~
!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'.
!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(t: X): number' has no corresponding signature in '(n: X) => string'
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
~~~~~~~
!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'.
!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(t: X): string' has no corresponding signature in '(m: X) => number'
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
~~~~~~~
!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'.
!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'.
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
!!! error TS2322: Signature '(t: X): boolean' has no corresponding signature in '(m: X) => number'
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
@@ -1,7 +1,8 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
Types of property 'a' are incompatible.
Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'.
Type 'string' is not assignable to type 'number'.
Signature 'new (x: number): number' has no corresponding signature in 'new (x: number) => string'
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts (1 errors) ====
@@ -70,7 +71,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! error TS2430: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'.
!!! error TS2430: Type 'string' is not assignable to type 'number'.
!!! error TS2430: Signature 'new (x: number): number' has no corresponding signature in 'new (x: number) => string'
!!! error TS2430: Type 'string' is not assignable to type 'number'.
// N's
a: new (x: number) => string; // error because base returns non-void;
}
@@ -1,17 +1,20 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
Types of property 'a2' are incompatible.
Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'.
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
Signature 'new (x: number): string[]' has no corresponding signature in 'new (x: T) => U[]'
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'.
Types of property 'a8' are incompatible.
Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
Types of parameters 'y' and 'y' are incompatible.
Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
Types of parameters 'arg2' and 'arg2' are incompatible.
Type '{ foo: number; }' is not assignable to type 'Base'.
Types of property 'foo' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ====
@@ -60,8 +63,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
!!! error TS2430: Interface 'I2<T, U>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a2' are incompatible.
!!! error TS2430: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'.
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430: Type 'T' is not assignable to type 'number'.
!!! error TS2430: Signature 'new (x: number): string[]' has no corresponding signature in 'new (x: T) => U[]'
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2430: Type 'T' is not assignable to type 'number'.
a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic
}
@@ -75,12 +79,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a8' are incompatible.
!!! error TS2430: Type 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'.
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2430: Types of property 'foo' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
!!! error TS2430: Signature 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived): (r: Base) => Derived' has no corresponding signature in 'new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'
!!! error TS2430: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'.
!!! error TS2430: Signature '(arg2: Base): Derived' has no corresponding signature in '(arg2: { foo: number; }) => any'
!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible.
!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'.
!!! error TS2430: Types of property 'foo' are incompatible.
!!! error TS2430: Type 'number' is not assignable to type 'string'.
a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
}
@@ -1,10 +1,12 @@
tests/cases/compiler/constructorAsType.ts(1,5): error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'.
Signature 'new (): { name: string; }' has no corresponding signature in '() => { name: string; }'
==== tests/cases/compiler/constructorAsType.ts (1 errors) ====
var Person:new () => {name: string;} = function () {return {name:"joe"};};
~~~~~~
!!! error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'.
!!! error TS2322: Signature 'new (): { name: string; }' has no corresponding signature in '() => { name: string; }'
var Person2:{new() : {name:string;};};
@@ -1,9 +1,10 @@
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
Types of property 'pop' are incompatible.
Type '() => number | string | boolean' is not assignable to type '() => number | string'.
Type 'number | string | boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'string'.
Signature '(): number | string' has no corresponding signature in '() => number | string | boolean'
Type 'number | string | boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'.
Types of property '0' are incompatible.
@@ -14,8 +15,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(19,1): error TS23
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(20,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => string'.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => string | number'
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(24,1): error TS2322: Type '[C, string | number]' is not assignable to type '[C, string | number, D]'.
Property '2' is missing in type '[C, string | number]'.
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS2322: Type '[number, string | number]' is not assignable to type '[number, string]'.
@@ -32,9 +34,10 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23
!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number | string'.
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number | string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'number | string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
!!! error TS2322: Signature '(): number | string' has no corresponding signature in '() => number | string | boolean'
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number | string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'number | string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
var numStrBoolTuple: [number, string, boolean] = [5, "foo", true];
var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5];
var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]];
@@ -66,8 +69,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23
!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'.
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => string | number'
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
unionTuple = unionTuple1;
unionTuple = unionTuple2;
@@ -27,8 +27,9 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(
Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'.
Types of property 'commonMethodDifferentReturnType' are incompatible.
Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'.
Type 'string | number' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Signature '(a: string, b: number): number' has no corresponding signature in '(a: string, b: number) => string | number'
Type 'string | number' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts (6 errors) ====
@@ -124,7 +125,8 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(
!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'.
!!! error TS2322: Types of property 'commonMethodDifferentReturnType' are incompatible.
!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'.
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(a: string, b: number): number' has no corresponding signature in '(a: string, b: number) => string | number'
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
commonMethodDifferentReturnType: (a, b) => strOrNumber,
};
@@ -1,11 +1,15 @@
tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'.
Types of parameters 'a' and 'a' are incompatible.
Type 'string' is not assignable to type '{ (): number; (i: number): number; }'.
Signature '(a: { (): number; (i: number): number; }): number' has no corresponding signature in '(a: string) => number'
Types of parameters 'a' and 'a' are incompatible.
Type 'string' is not assignable to type '{ (): number; (i: number): number; }'.
Signature '(): number' has no corresponding signature in 'String'
==== tests/cases/compiler/contextualTyping24.ts (1 errors) ====
var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5};
~~~
!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'.
!!! error TS2322: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'.
!!! error TS2322: Signature '(a: { (): number; (i: number): number; }): number' has no corresponding signature in '(a: string) => number'
!!! error TS2322: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'.
!!! error TS2322: Signature '(): number' has no corresponding signature in 'String'
@@ -1,9 +1,11 @@
tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/contextualTyping39.ts (1 errors) ====
var foo = <{ (): number; }> function() { return "err"; };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
!!! error TS2352: Signature '(): number' has no corresponding signature in '() => string'
!!! error TS2352: Type 'string' is not assignable to type 'number'.
@@ -1,9 +1,11 @@
tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/contextualTyping41.ts (1 errors) ====
var foo = <{():number; (i:number):number; }> (function(){return "err";});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
!!! error TS2352: Signature '(): number' has no corresponding signature in '() => string'
!!! error TS2352: Type 'string' is not assignable to type 'number'.
@@ -1,8 +1,9 @@
tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'.
Type '(b: number) => void' is not assignable to type '(a: A) => void'.
Types of parameters 'b' and 'a' are incompatible.
Type 'number' is not assignable to type 'A'.
Property 'foo' is missing in type 'Number'.
Signature '(a: A): void' has no corresponding signature in '(b: number) => void'
Types of parameters 'b' and 'a' are incompatible.
Type 'number' is not assignable to type 'A'.
Property 'foo' is missing in type 'Number'.
==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (1 errors) ====
@@ -20,7 +21,8 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS
~~
!!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'.
!!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'.
!!! error TS2322: Types of parameters 'b' and 'a' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'A'.
!!! error TS2322: Property 'foo' is missing in type 'Number'.
!!! error TS2322: Signature '(a: A): void' has no corresponding signature in '(b: number) => void'
!!! error TS2322: Types of parameters 'b' and 'a' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'A'.
!!! error TS2322: Property 'foo' is missing in type 'Number'.
@@ -1,8 +1,10 @@
tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(16,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'.
Type 'string' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'String'.
Signature '(x: number): Date' has no corresponding signature in '(x: number) => string'
Type 'string' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'String'.
tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'.
Type 'string' is not assignable to type 'Date'.
Signature '(x: number): Date' has no corresponding signature in '(x: number) => string'
Type 'string' is not assignable to type 'Date'.
==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ====
@@ -24,10 +26,12 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32):
var r5 = _.forEach<number>(c2, f);
~
!!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'.
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
!!! error TS2345: Property 'toDateString' is missing in type 'String'.
!!! error TS2345: Signature '(x: number): Date' has no corresponding signature in '(x: number) => string'
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
!!! error TS2345: Property 'toDateString' is missing in type 'String'.
var r6 = _.forEach<number>(c2, (x) => { return x.toFixed() });
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'.
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
!!! error TS2345: Signature '(x: number): Date' has no corresponding signature in '(x: number) => string'
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
@@ -1,8 +1,9 @@
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'.
Types of property 'foo' are incompatible.
Type '(x?: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x?: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts (1 errors) ====
@@ -28,7 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra
!!! error TS2322: Type 'E' is not assignable to type 'C'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x?: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var r = c.foo(1);
var r2 = e.foo('');
@@ -1,8 +1,9 @@
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'.
Types of property 'foo' are incompatible.
Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'.
Types of parameters 'y' and 'y' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number, y: number): void' has no corresponding signature in '(x: number, y?: string) => void'
Types of parameters 'y' and 'y' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts (1 errors) ====
@@ -28,7 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra
!!! error TS2322: Type 'E' is not assignable to type 'C'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number, y: number): void' has no corresponding signature in '(x: number, y?: string) => void'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var r = c.foo(1, 1);
var r2 = e.foo(1, '');
@@ -1,8 +1,9 @@
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E<string>' is not assignable to type 'C<string>'.
Types of property 'foo' are incompatible.
Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'.
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: string, y: string): void' has no corresponding signature in '(x: string, y?: number) => void'
Types of parameters 'y' and 'y' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts (1 errors) ====
@@ -28,7 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra
!!! error TS2322: Type 'E<string>' is not assignable to type 'C<string>'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'.
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: string, y: string): void' has no corresponding signature in '(x: string, y?: number) => void'
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var r = c.foo('', '');
var r2 = e.foo('', 1);
@@ -1,8 +1,9 @@
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'.
Types of property 'foo' are incompatible.
Type '(x?: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x?: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(19,9): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
@@ -29,8 +30,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra
!!! error TS2322: Type 'E' is not assignable to type 'C'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x?: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var r = c.foo(1);
~~~~~
!!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses.
@@ -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'.
Signature '(): (data: any, index?: number) => number' has no corresponding signature in '(x: (data: any, index?: number) => number) => D3SvgArea'
==== 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: Signature '(): (data: any, index?: number) => number' has no corresponding signature in '(x: (data: any, index?: number) => number) => D3SvgArea'
x(x: (data: any, index?: number) => number): D3SvgArea;
y(y: (data: any, index?: number) => number): D3SvgArea;
y0(): (data: any, index?: number) => number;
@@ -5,10 +5,11 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(8,4): error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'.
Types of property 'pop' are incompatible.
Type '() => number | string[][] | string' is not assignable to type '() => number | string[][]'.
Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'string[][]'.
Property 'push' is missing in type 'String'.
Signature '(): number | string[][]' has no corresponding signature in '() => number | string[][] | string'
Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'string[][]'.
Property 'push' is missing in type 'String'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,16): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(23,14): error TS2345: Argument of type '{ x: string; y: boolean; }' is not assignable to parameter of type '{ x: number; y: any; }'.
@@ -47,9 +48,10 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(55,7): error TS2420: Class 'C4' incorrectly implements interface 'F2'.
Types of property 'd4' are incompatible.
Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'.
Types of parameters '__0' and '__0' are incompatible.
Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'.
Property 'z' is missing in type '{ x: any; y: any; c: any; }'.
Signature '({x, y, z}?: { x: any; y: any; z: any; }): any' has no corresponding signature in '({x, y, c}: { x: any; y: any; c: any; }) => void'
Types of parameters '__0' and '__0' are incompatible.
Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'.
Property 'z' is missing in type '{ x: any; y: any; c: any; }'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(56,8): error TS2463: A binding pattern parameter cannot be optional in an implementation signature.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,18): error TS2300: Duplicate identifier 'number'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(65,26): error TS2300: Duplicate identifier 'number'.
@@ -75,10 +77,11 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
!!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'.
!!! error TS2345: Types of property 'pop' are incompatible.
!!! error TS2345: Type '() => number | string[][] | string' is not assignable to type '() => number | string[][]'.
!!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'string[][]'.
!!! error TS2345: Property 'push' is missing in type 'String'.
!!! error TS2345: Signature '(): number | string[][]' has no corresponding signature in '() => number | string[][] | string'
!!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'string[][]'.
!!! error TS2345: Property 'push' is missing in type 'String'.
// If the declaration includes an initializer expression (which is permitted only
@@ -179,9 +182,10 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
!!! error TS2420: Class 'C4' incorrectly implements interface 'F2'.
!!! error TS2420: Types of property 'd4' are incompatible.
!!! error TS2420: Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'.
!!! error TS2420: Types of parameters '__0' and '__0' are incompatible.
!!! error TS2420: Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'.
!!! error TS2420: Property 'z' is missing in type '{ x: any; y: any; c: any; }'.
!!! error TS2420: Signature '({x, y, z}?: { x: any; y: any; z: any; }): any' has no corresponding signature in '({x, y, c}: { x: any; y: any; c: any; }) => void'
!!! error TS2420: Types of parameters '__0' and '__0' are incompatible.
!!! error TS2420: Type '{ x: any; y: any; c: any; }' is not assignable to type '{ x: any; y: any; z: any; }'.
!!! error TS2420: Property 'z' is missing in type '{ x: any; y: any; c: any; }'.
d3([a, b, c]?) { } // Error, binding pattern can't be optional in implementation signature
~~~~~~~~~~
!!! error TS2463: A binding pattern parameter cannot be optional in an implementation signature.
@@ -6,9 +6,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
Property 'toDateString' is missing in type 'Number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'.
Signature '(): {}' has no corresponding signature in 'Number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'.
Property 'apply' is missing in type 'Number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'.
Signature '(x: number): string' has no corresponding signature in 'Number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'.
Property 'foo' is missing in type 'Number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'.
@@ -18,6 +20,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is missing in type 'Number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '<T>(x: T) => T'.
Signature '<T>(x: T): T' has no corresponding signature in 'Number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'.
Property 'charAt' is missing in type 'Number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
@@ -80,6 +83,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
var j: () => {} = e;
~
!!! error TS2322: Type 'E' is not assignable to type '() => {}'.
!!! error TS2322: Signature '(): {}' has no corresponding signature in 'Number'
var k: Function = e;
~
!!! error TS2322: Type 'E' is not assignable to type 'Function'.
@@ -87,6 +91,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
var l: (x: number) => string = e;
~
!!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'.
!!! error TS2322: Signature '(x: number): string' has no corresponding signature in 'Number'
ac = e;
~~
!!! error TS2322: Type 'E' is not assignable to type 'C'.
@@ -106,6 +111,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
var o: <T>(x: T) => T = e;
~
!!! error TS2322: Type 'E' is not assignable to type '<T>(x: T) => T'.
!!! error TS2322: Signature '<T>(x: T): T' has no corresponding signature in 'Number'
var p: Number = e;
var q: String = e;
~
@@ -1,7 +1,8 @@
tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type '() => Container<Ref<string>>' is not assignable to parameter of type '() => Container<Ref<number>>'.
Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
Type 'Ref<string>' is not assignable to type 'Ref<number>'.
Type 'string' is not assignable to type 'number'.
Signature '(): Container<Ref<number>>' has no corresponding signature in '() => Container<Ref<string>>'
Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
Type 'Ref<string>' is not assignable to type 'Ref<number>'.
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/errorElaboration.ts (1 errors) ====
@@ -19,7 +20,8 @@ tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type '
foo(a);
~
!!! error TS2345: Argument of type '() => Container<Ref<string>>' is not assignable to parameter of type '() => Container<Ref<number>>'.
!!! error TS2345: Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
!!! error TS2345: Type 'Ref<string>' is not assignable to type 'Ref<number>'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2345: Signature '(): Container<Ref<number>>' has no corresponding signature in '() => Container<Ref<string>>'
!!! error TS2345: Type 'Container<Ref<string>>' is not assignable to type 'Container<Ref<number>>'.
!!! error TS2345: Type 'Ref<string>' is not assignable to type 'Ref<number>'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
@@ -1,5 +1,6 @@
tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'.
Type 'void' is not assignable to type 'boolean'.
Signature '(): boolean' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'boolean'.
tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
@@ -7,7 +8,8 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355:
var n1: () => boolean = function () { }; // expect an error here
~~
!!! error TS2322: Type '() => void' is not assignable to type '() => boolean'.
!!! error TS2322: Type 'void' is not assignable to type 'boolean'.
!!! error TS2322: Signature '(): boolean' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'boolean'.
var n2: () => boolean = function ():boolean { }; // expect an error here
~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
@@ -16,21 +16,26 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd
Types of property 'id' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean'
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean'
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'.
Type 'string' is not assignable to type 'number'.
Signature '(x: string): number' has no corresponding signature in '(x: string) => string'
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M'.
Types of property 'A' are incompatible.
Type 'typeof N.A' is not assignable to type 'typeof M.A'.
Type 'N.A' is not assignable to type 'M.A'.
Property 'name' is missing in type 'A'.
Signature 'new (): A' has no corresponding signature in 'typeof A'
Type 'N.A' is not assignable to type 'M.A'.
Property 'name' is missing in type 'A'.
tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'N.A' is not assignable to type 'M.A'.
tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'.
Type 'boolean' is not assignable to type 'string'.
Signature '(x: number): string' has no corresponding signature in '(x: number) => boolean'
Type 'boolean' is not assignable to type 'string'.
==== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts (15 errors) ====
@@ -108,31 +113,36 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd
var aFunction: typeof F = F2;
~~~~~~~~~
!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var anOtherFunction: (x: string) => number = F2;
~~~~~~~~~~~~~~~
!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: string): number' has no corresponding signature in '(x: number) => boolean'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var aLambda: typeof F = (x) => 'a string';
~~~~~~~
!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: string): number' has no corresponding signature in '(x: string) => string'
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var aModule: typeof M = N;
~~~~~~~
!!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M'.
!!! error TS2322: Types of property 'A' are incompatible.
!!! error TS2322: Type 'typeof N.A' is not assignable to type 'typeof M.A'.
!!! error TS2322: Type 'N.A' is not assignable to type 'M.A'.
!!! error TS2322: Property 'name' is missing in type 'A'.
!!! error TS2322: Signature 'new (): A' has no corresponding signature in 'typeof A'
!!! error TS2322: Type 'N.A' is not assignable to type 'M.A'.
!!! error TS2322: Property 'name' is missing in type 'A'.
var aClassInModule: M.A = new N.A();
~~~~~~~~~~~~~~
!!! error TS2322: Type 'N.A' is not assignable to type 'M.A'.
var aFunctionInModule: typeof M.F2 = F2;
~~~~~~~~~~~~~~~~~
!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: number): string' has no corresponding signature in '(x: number) => boolean'
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
@@ -1,7 +1,8 @@
tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2420: Class 'D' incorrectly implements interface 'C<number>'.
Types of property 'bar' are incompatible.
Type '() => string' is not assignable to type '() => number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'.
@@ -18,7 +19,8 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322:
!!! error TS2420: Class 'D' incorrectly implements interface 'C<number>'.
!!! error TS2420: Types of property 'bar' are incompatible.
!!! error TS2420: Type '() => string' is not assignable to type '() => number'.
!!! error TS2420: Type 'string' is not assignable to type 'number'.
!!! error TS2420: Signature '(): number' has no corresponding signature in '() => string'
!!! error TS2420: Type 'string' is not assignable to type 'number'.
baz() { }
}
@@ -1,8 +1,10 @@
tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(11,27): error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'.
Type 'Base' is not assignable to type 'Derived'.
Property 'toBase' is missing in type 'Base'.
Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base'
Type 'Base' is not assignable to type 'Derived'.
Property 'toBase' is missing in type 'Base'.
tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,27): error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'.
Type 'Base' is not assignable to type 'Derived'.
Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base'
Type 'Base' is not assignable to type 'Derived'.
==== tests/cases/compiler/fixingTypeParametersRepeatedly2.ts (2 errors) ====
@@ -19,8 +21,9 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,27): error TS2345: Ar
var result = foo(derived, d => d.toBase());
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'.
!!! error TS2345: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2345: Property 'toBase' is missing in type 'Base'.
!!! error TS2345: Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base'
!!! error TS2345: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2345: Property 'toBase' is missing in type 'Base'.
// bar should type check just like foo.
// The same error should be observed in both cases.
@@ -29,4 +32,5 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,27): error TS2345: Ar
var result = bar(derived, d => d.toBase());
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(d: Derived) => Base' is not assignable to parameter of type '(p: Derived) => Derived'.
!!! error TS2345: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2345: Signature '(p: Derived): Derived' has no corresponding signature in '(d: Derived) => Base'
!!! error TS2345: Type 'Base' is not assignable to type 'Derived'.
+10 -6
View File
@@ -1,9 +1,11 @@
tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
Types of property 'return' are incompatible.
Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
Signature '(): Iterator<string>' has no corresponding signature in '() => StringIterator'
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
Types of property 'return' are incompatible.
Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
Signature '(value?: any): IteratorResult<string>' has no corresponding signature in 'Number'
==== tests/cases/conformance/es6/for-ofStatements/for-of30.ts (1 errors) ====
@@ -12,9 +14,11 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Ty
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'return' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Signature '(): Iterator<string>' has no corresponding signature in '() => StringIterator'
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'return' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Signature '(value?: any): IteratorResult<string>' has no corresponding signature in 'Number'
class StringIterator {
next() {
+14 -10
View File
@@ -1,11 +1,13 @@
tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
Types of property 'next' are incompatible.
Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
Type '{ value: string; }' is not assignable to type 'IteratorResult<string>'.
Property 'done' is missing in type '{ value: string; }'.
Signature '(): Iterator<string>' has no corresponding signature in '() => StringIterator'
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
Types of property 'next' are incompatible.
Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
Signature '(value?: any): IteratorResult<string>' has no corresponding signature in '() => { value: string; }'
Type '{ value: string; }' is not assignable to type 'IteratorResult<string>'.
Property 'done' is missing in type '{ value: string; }'.
==== tests/cases/conformance/es6/for-ofStatements/for-of31.ts (1 errors) ====
@@ -14,11 +16,13 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Ty
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult<string>'.
!!! error TS2322: Property 'done' is missing in type '{ value: string; }'.
!!! error TS2322: Signature '(): Iterator<string>' has no corresponding signature in '() => StringIterator'
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Signature '(value?: any): IteratorResult<string>' has no corresponding signature in '() => { value: string; }'
!!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult<string>'.
!!! error TS2322: Property 'done' is missing in type '{ value: string; }'.
class StringIterator {
next() {
@@ -3,15 +3,23 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'.
Signature '(x: string): string' has no corresponding signature in 'Function'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(24,15): error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string[]' is not assignable to type 'string'.
Signature '(x: string): string' has no corresponding signature in '(x: string[]) => string[]'
Types of parameters 'x' and 'x' are incompatible.
Type 'string[]' is not assignable to type 'string'.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(25,15): error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'.
Signature '(x: string): string' has no corresponding signature in 'typeof C'
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'.
Signature '(x: string): string' has no corresponding signature in 'new (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'.
Signature '(x: string): string' has no corresponding signature in '<U, V>(x: U, y: V) => U'
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'.
Signature '(x: string): string' has no corresponding signature in 'typeof C2'
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'.
Signature '(x: string): string' has no corresponding signature in 'new <T>(x: T) => T'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(34,16): error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'.
Signature '(x: string): string' has no corresponding signature in 'F2'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(36,38): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'.
Type '() => void' is not assignable to type '(x: string) => string'.
@@ -51,33 +59,41 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
var r = foo2(new Function());
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'Function'
var r2 = foo2((x: string[]) => x);
~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2345: Type 'string[]' is not assignable to type 'string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in '(x: string[]) => string[]'
!!! error TS2345: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2345: Type 'string[]' is not assignable to type 'string'.
var r6 = foo2(C);
~
!!! error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'typeof C'
var r7 = foo2(b);
~
!!! error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'new (x: string) => string'
var r8 = foo2(<U>(x: U) => x); // no error expected
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: Signature '(x: string): string' has no corresponding signature in '<U, V>(x: U, y: V) => U'
var r13 = foo2(C2);
~~
!!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'typeof C2'
var r14 = foo2(b2);
~~
!!! error TS2345: Argument of type 'new <T>(x: T) => T' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'new <T>(x: T) => T'
interface F2 extends Function { foo: string; }
var f2: F2;
var r16 = foo2(f2);
~~
!!! error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Signature '(x: string): string' has no corresponding signature in 'F2'
function fff<T extends { (): void }, U extends T>(x: T, y: U) {
~~~~~~~~~~~
@@ -1,6 +1,7 @@
tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts(11,1): error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'.
Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'.
Type 'boolean' is not assignable to type 'string'.
Signature '(n: number, s: string): string' has no corresponding signature in '(foo: number, bar: string) => boolean'
Type 'boolean' is not assignable to type 'string'.
==== tests/cases/conformance/expressions/contextualTyping/functionExpressionContextualTyping2.ts (1 errors) ====
@@ -18,4 +19,5 @@ tests/cases/conformance/expressions/contextualTyping/functionExpressionContextua
~~
!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '((n: number, s: string) => number) | ((n: number, s: string) => string)'.
!!! error TS2322: Type '(foo: number, bar: string) => boolean' is not assignable to type '(n: number, s: string) => string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
!!! error TS2322: Signature '(n: number, s: string): string' has no corresponding signature in '(foo: number, bar: string) => boolean'
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
@@ -1,6 +1,7 @@
tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'.
Types of parameters 'delimiter' and 'eventEmitter' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(eventEmitter: number, buffer: string): void' has no corresponding signature in '(delimiter?: string) => ParserFunc'
Types of parameters 'delimiter' and 'eventEmitter' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/functionSignatureAssignmentCompat1.ts (1 errors) ====
@@ -16,6 +17,7 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322:
var d: ParserFunc = parsers.readline; // not ok
~
!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'.
!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(eventEmitter: number, buffer: string): void' has no corresponding signature in '(delimiter?: string) => ParserFunc'
!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var e: ParserFunc = parsers.readline(); // ok
@@ -1,14 +1,17 @@
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error TS2322: Type '() => IterableIterator<Bar | Baz>' is not assignable to type '() => Iterable<Foo>'.
Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterable<Foo>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => IterableIterator<Bar | Baz>' is not assignable to type '() => Iterator<Foo>'.
Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterator<Foo>'.
Types of property 'next' are incompatible.
Type '(value?: any) => IteratorResult<Bar | Baz>' is not assignable to type '(value?: any) => IteratorResult<Foo>'.
Type 'IteratorResult<Bar | Baz>' is not assignable to type 'IteratorResult<Foo>'.
Type 'Bar | Baz' is not assignable to type 'Foo'.
Type 'Baz' is not assignable to type 'Foo'.
Property 'x' is missing in type 'Baz'.
Signature '(): Iterable<Foo>' has no corresponding signature in '() => IterableIterator<Bar | Baz>'
Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterable<Foo>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => IterableIterator<Bar | Baz>' is not assignable to type '() => Iterator<Foo>'.
Signature '(): Iterator<Foo>' has no corresponding signature in '() => IterableIterator<Bar | Baz>'
Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterator<Foo>'.
Types of property 'next' are incompatible.
Type '(value?: any) => IteratorResult<Bar | Baz>' is not assignable to type '(value?: any) => IteratorResult<Foo>'.
Signature '(value?: any): IteratorResult<Foo>' has no corresponding signature in '(value?: any) => IteratorResult<Bar | Baz>'
Type 'IteratorResult<Bar | Baz>' is not assignable to type 'IteratorResult<Foo>'.
Type 'Bar | Baz' is not assignable to type 'Foo'.
Type 'Baz' is not assignable to type 'Foo'.
Property 'x' is missing in type 'Baz'.
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts (1 errors) ====
@@ -18,16 +21,19 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck25.ts(4,5): error
var g3: () => Iterable<Foo> = function* () {
~~
!!! error TS2322: Type '() => IterableIterator<Bar | Baz>' is not assignable to type '() => Iterable<Foo>'.
!!! error TS2322: Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterable<Foo>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => IterableIterator<Bar | Baz>' is not assignable to type '() => Iterator<Foo>'.
!!! error TS2322: Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterator<Foo>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '(value?: any) => IteratorResult<Bar | Baz>' is not assignable to type '(value?: any) => IteratorResult<Foo>'.
!!! error TS2322: Type 'IteratorResult<Bar | Baz>' is not assignable to type 'IteratorResult<Foo>'.
!!! error TS2322: Type 'Bar | Baz' is not assignable to type 'Foo'.
!!! error TS2322: Type 'Baz' is not assignable to type 'Foo'.
!!! error TS2322: Property 'x' is missing in type 'Baz'.
!!! error TS2322: Signature '(): Iterable<Foo>' has no corresponding signature in '() => IterableIterator<Bar | Baz>'
!!! error TS2322: Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterable<Foo>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => IterableIterator<Bar | Baz>' is not assignable to type '() => Iterator<Foo>'.
!!! error TS2322: Signature '(): Iterator<Foo>' has no corresponding signature in '() => IterableIterator<Bar | Baz>'
!!! error TS2322: Type 'IterableIterator<Bar | Baz>' is not assignable to type 'Iterator<Foo>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '(value?: any) => IteratorResult<Bar | Baz>' is not assignable to type '(value?: any) => IteratorResult<Foo>'.
!!! error TS2322: Signature '(value?: any): IteratorResult<Foo>' has no corresponding signature in '(value?: any) => IteratorResult<Bar | Baz>'
!!! error TS2322: Type 'IteratorResult<Bar | Baz>' is not assignable to type 'IteratorResult<Foo>'.
!!! error TS2322: Type 'Bar | Baz' is not assignable to type 'Foo'.
!!! error TS2322: Type 'Baz' is not assignable to type 'Foo'.
!!! error TS2322: Property 'x' is missing in type 'Baz'.
yield;
yield new Bar;
yield new Baz;
@@ -1,4 +1,5 @@
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'.
Signature '(): Iterable<(x: string) => number>' has no corresponding signature in 'IterableIterator<(x: any) => any>'
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts (1 errors) ====
@@ -10,4 +11,5 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): erro
} ()
~~~~~~~~
!!! error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'.
!!! error TS2322: Signature '(): Iterable<(x: string) => number>' has no corresponding signature in 'IterableIterator<(x: any) => any>'
}
@@ -1,8 +1,9 @@
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error TS2322: Type 'IterableIterator<string>' is not assignable to type 'BadGenerator'.
Types of property 'next' are incompatible.
Type '(value?: any) => IteratorResult<string>' is not assignable to type '(value?: any) => IteratorResult<number>'.
Type 'IteratorResult<string>' is not assignable to type 'IteratorResult<number>'.
Type 'string' is not assignable to type 'number'.
Signature '(value?: any): IteratorResult<number>' has no corresponding signature in '(value?: any) => IteratorResult<string>'
Type 'IteratorResult<string>' is not assignable to type 'IteratorResult<number>'.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts (1 errors) ====
@@ -12,5 +13,6 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error
!!! error TS2322: Type 'IterableIterator<string>' is not assignable to type 'BadGenerator'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '(value?: any) => IteratorResult<string>' is not assignable to type '(value?: any) => IteratorResult<number>'.
!!! error TS2322: Type 'IteratorResult<string>' is not assignable to type 'IteratorResult<number>'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(value?: any): IteratorResult<number>' has no corresponding signature in '(value?: any) => IteratorResult<string>'
!!! error TS2322: Type 'IteratorResult<string>' is not assignable to type 'IteratorResult<number>'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -3,8 +3,9 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS23
Type 'A<number>' is not assignable to type 'Comparable<string>'.
Types of property 'compareTo' are incompatible.
Type '(other: number) => number' is not assignable to type '(other: string) => number'.
Types of parameters 'other' and 'other' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(other: string): number' has no corresponding signature in '(other: number) => number'
Types of parameters 'other' and 'other' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A<number>; }' is not assignable to type 'I<string>'.
Types of property 'x' are incompatible.
Type 'A<number>' is not assignable to type 'Comparable<string>'.
@@ -35,8 +36,9 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS23
!!! error TS2322: Type 'A<number>' is not assignable to type 'Comparable<string>'.
!!! error TS2322: Types of property 'compareTo' are incompatible.
!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'.
!!! error TS2322: Types of parameters 'other' and 'other' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(other: string): number' has no corresponding signature in '(other: number) => number'
!!! error TS2322: Types of parameters 'other' and 'other' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
var a2: I<string> = function (): { x: A<number> } {
~~
!!! error TS2322: Type '{ x: A<number>; }' is not assignable to type 'I<string>'.
@@ -1,15 +1,19 @@
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(24,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
Signature '(x: number): Promise<string>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; }'
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(53,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
Signature '(x: number): Promise<string>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; }'
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(69,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
Signature '(x: number): Promise<string>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; }'
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(85,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
Type 'number' is not assignable to type 'boolean'.
Signature '(x: number): Promise<boolean>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }'
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
Type 'number' is not assignable to type 'boolean'.
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ====
@@ -39,8 +43,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2345: Signature '(x: number): Promise<string>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; }'
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
}
//////////////////////////////////////
@@ -72,8 +77,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2345: Signature '(x: number): Promise<string>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; }'
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
}
//////////////////////////////////////
@@ -92,8 +98,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
!!! error TS2345: Signature '(x: number): Promise<string>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; }'
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
}
//////////////////////////////////////
@@ -112,7 +119,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
!!! error TS2345: Type 'number' is not assignable to type 'boolean'.
!!! error TS2345: Signature '(x: number): Promise<boolean>' has no corresponding signature in '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }'
!!! error TS2345: Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
!!! error TS2345: Type 'number' is not assignable to type 'boolean'.
}
@@ -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: any) => string; }'.
Types of property 'cb' are incompatible.
Type 'new <T>(x: T, y: T) => string' is not assignable to type 'new (t: any) => string'.
Signature 'new (t: any): string' has no corresponding signature in 'new <T>(x: T, y: T) => string'
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'.
Signature 'new (t: string): string' has no corresponding signature in 'new (x: string, y: number) => string'
==== 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: any) => 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: any) => string'.
!!! error TS2345: Signature 'new (t: any): string' has no corresponding signature in 'new <T>(x: T, y: T) => string'
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: Signature 'new (t: string): string' has no corresponding signature in 'new (x: string, y: number) => string'
function foo2<T, U>(arg: { cb: new(t: T, t2: T) => U }) {
return new arg.cb(null, null);
@@ -3,18 +3,21 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
Types of parameters 'a' and 'x' are incompatible.
Type 'T' is not assignable to type 'Date'.
Type 'RegExp' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'RegExp'.
Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T'
Types of parameters 'a' and 'x' are incompatible.
Type 'T' is not assignable to type 'Date'.
Type 'RegExp' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'RegExp'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(37,36): error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'.
Type 'F' is not assignable to type 'E'.
Signature '(x: E): E' has no corresponding signature in '(x: E) => F'
Type 'F' is not assignable to type 'E'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(50,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(60,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
Types of parameters 'a' and 'x' are incompatible.
Type 'T' is not assignable to type 'Date'.
Type 'RegExp' is not assignable to type 'Date'.
Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T'
Types of parameters 'a' and 'x' are incompatible.
Type 'T' is not assignable to type 'Date'.
Type 'RegExp' is not assignable to type 'Date'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(67,51): error TS2304: Cannot find name 'U'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(67,57): error TS2304: Cannot find name 'U'.
@@ -54,10 +57,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
var r7 = foo2((a: T) => a, (b: T) => b); // error
~~~~~~~~~~~
!!! error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
!!! error TS2345: Types of parameters 'a' and 'x' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type 'Date'.
!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'.
!!! error TS2345: Property 'toDateString' is missing in type 'RegExp'.
!!! error TS2345: Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T'
!!! error TS2345: Types of parameters 'a' and 'x' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type 'Date'.
!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'.
!!! error TS2345: Property 'toDateString' is missing in type 'RegExp'.
var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date
}
@@ -72,7 +76,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error
~~~~~~~~~~
!!! error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'.
!!! error TS2345: Type 'F' is not assignable to type 'E'.
!!! error TS2345: Signature '(x: E): E' has no corresponding signature in '(x: E) => F'
!!! error TS2345: Type 'F' is not assignable to type 'E'.
}
module TU {
@@ -102,9 +107,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
var r7 = foo2((a: T) => a, (b: T) => b);
~~~~~~~~~~~
!!! error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'.
!!! error TS2345: Types of parameters 'a' and 'x' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type 'Date'.
!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'.
!!! error TS2345: Signature '(x: Date): Date' has no corresponding signature in '(a: T) => T'
!!! error TS2345: Types of parameters 'a' and 'x' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type 'Date'.
!!! error TS2345: Type 'RegExp' is not assignable to type 'Date'.
var r7b = foo2((a) => a, (b) => b);
}
@@ -1,8 +1,10 @@
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'.
Type 'boolean' is not assignable to type 'string'.
Signature '(y: string): string' has no corresponding signature in '(a: string) => boolean'
Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'.
Signature '(n: Object): number' has no corresponding signature in 'Number'
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts (2 errors) ====
@@ -41,8 +43,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
~~~~
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
!!! error TS2453: Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'.
!!! error TS2453: Type 'boolean' is not assignable to type 'string'.
!!! error TS2453: Signature '(y: string): string' has no corresponding signature in '(a: string) => boolean'
!!! error TS2453: Type 'boolean' is not assignable to type 'string'.
var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // error
~~~~
!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
!!! error TS2453: Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'.
!!! error TS2453: Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'.
!!! error TS2453: Signature '(n: Object): number' has no corresponding signature in 'Number'
@@ -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: any): string; new (x: any, y?: any): string; }'.
Signature 'new (x: any): string' has no corresponding signature in 'new <T>(x: T, y: T) => string'
==== 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: any): string; new (x: any, y?: any): string; }'.
!!! error TS2345: Signature 'new (x: any): string' has no corresponding signature in 'new <T>(x: T, y: T) => string'
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: any): string; (x: any, y?: any): string; }'.
Signature '(x: any): string' has no corresponding signature in '<T>(x: T, y: T) => string'
==== 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: any): string; (x: any, y?: any): string; }'.
!!! error TS2345: Signature '(x: any): string' has no corresponding signature in '<T>(x: T, y: T) => string'
function foo7<T>(x:T, cb: { (x: T): string; (x: T, y?: T): string }) {
return cb;
@@ -1,9 +1,10 @@
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'.
Types of property 'pop' are incompatible.
Type '() => string | number | boolean' is not assignable to type '() => string | number'.
Type 'string | number | boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'number'.
Signature '(): string | number' has no corresponding signature in '() => string | number | boolean'
Type 'string | number | boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'.
Type '{ a: string; }' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'.
@@ -33,9 +34,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup
!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'.
!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'.
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
!!! error TS2322: Signature '(): string | number' has no corresponding signature in '() => string | number | boolean'
!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'.
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
var e3 = i1.tuple1[2]; // {}
i1.tuple1[3] = { a: "string" };
~~~~~~~~~~~~
@@ -1,8 +1,10 @@
tests/cases/compiler/genericCombinators2.ts(15,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'.
Type 'string' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'String'.
Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string'
Type 'string' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'String'.
tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'.
Type 'string' is not assignable to type 'Date'.
Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string'
Type 'string' is not assignable to type 'Date'.
==== tests/cases/compiler/genericCombinators2.ts (2 errors) ====
@@ -23,9 +25,11 @@ tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of ty
var r5a = _.map<number, string, Date>(c2, (x, y) => { return x.toFixed() });
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'.
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
!!! error TS2345: Property 'toDateString' is missing in type 'String'.
!!! error TS2345: Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string'
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
!!! error TS2345: Property 'toDateString' is missing in type 'String'.
var r5b = _.map<number, string, Date>(c2, rf1);
~~~
!!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'.
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
!!! error TS2345: Signature '(x: number, y: string): Date' has no corresponding signature in '(x: number, y: string) => string'
!!! error TS2345: Type 'string' is not assignable to type 'Date'.
@@ -1,18 +1,21 @@
tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo<number>'.
Types of property 'foo' are incompatible.
Type '(x: string) => string' is not assignable to type '(x: number) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): number' has no corresponding signature in '(x: string) => string'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'.
Types of property 'foo' are incompatible.
Type '(x: string) => string' is not assignable to type '(x: number) => number'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): number' has no corresponding signature in '(x: string) => string'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'.
Types of property 'foo' are incompatible.
Type '(x: number) => number' is not assignable to type '(x: string) => string'.
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(x: string): string' has no corresponding signature in '(x: number) => number'
Types of parameters 'x' and 'x' are incompatible.
Type 'number' is not assignable to type 'string'.
==== tests/cases/compiler/genericSpecializations3.ts (3 errors) ====
@@ -28,8 +31,9 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo
!!! error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo<number>'.
!!! error TS2420: Types of property 'foo' are incompatible.
!!! error TS2420: Type '(x: string) => string' is not assignable to type '(x: number) => number'.
!!! error TS2420: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2420: Type 'string' is not assignable to type 'number'.
!!! error TS2420: Signature '(x: number): number' has no corresponding signature in '(x: string) => string'
!!! error TS2420: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2420: Type 'string' is not assignable to type 'number'.
foo(x: string): string { return null; }
}
@@ -54,15 +58,17 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo
!!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '(x: string) => string'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
stringFoo2 = intFoo; // error
~~~~~~~~~~
!!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(x: string): string' has no corresponding signature in '(x: number) => number'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
class StringFoo3 implements IFoo<string> { // error
@@ -1,8 +1,9 @@
tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B<string>' is not assignable to type 'A<number>'.
Types of property 'foo' are incompatible.
Type '(x: string) => void' is not assignable to type '(x: number) => void'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A<number>' is not assignable to type 'B<number>'.
Property 'bar' is missing in type 'A<number>'.
tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither type 'undefined[]' nor type 'A<number>' is assignable to the other.
@@ -24,8 +25,9 @@ tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither typ
!!! error TS2322: Type 'B<string>' is not assignable to type 'A<number>'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): void' has no corresponding signature in '(x: string) => void'
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var r3: B<number> = <A<number>>new B(); // error
~~
!!! error TS2322: Type 'A<number>' is not assignable to type 'B<number>'.
@@ -1,18 +1,20 @@
tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2420: Class 'X<T>' incorrectly implements interface 'I'.
Types of property 'f' are incompatible.
Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'.
Types of parameters 'a' and 'a' are incompatible.
Type 'T' is not assignable to type '{ a: number; }'.
Type '{ a: string; }' is not assignable to type '{ a: number; }'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(a: { a: number; }): void' has no corresponding signature in '(a: T) => void'
Types of parameters 'a' and 'a' are incompatible.
Type 'T' is not assignable to type '{ a: number; }'.
Type '{ a: string; }' is not assignable to type '{ a: number; }'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'.
Types of property 'f' are incompatible.
Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'.
Types of parameters 'a' and 'a' are incompatible.
Type '{ a: string; }' is not assignable to type '{ a: number; }'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
Signature '(a: { a: number; }): void' has no corresponding signature in '(a: { a: string; }) => void'
Types of parameters 'a' and 'a' are incompatible.
Type '{ a: string; }' is not assignable to type '{ a: number; }'.
Types of property 'a' are incompatible.
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts (2 errors) ====
@@ -24,11 +26,12 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322
!!! error TS2420: Class 'X<T>' incorrectly implements interface 'I'.
!!! error TS2420: Types of property 'f' are incompatible.
!!! error TS2420: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'.
!!! error TS2420: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'.
!!! error TS2420: Type '{ a: string; }' is not assignable to type '{ a: number; }'.
!!! error TS2420: Types of property 'a' are incompatible.
!!! error TS2420: Type 'string' is not assignable to type 'number'.
!!! error TS2420: Signature '(a: { a: number; }): void' has no corresponding signature in '(a: T) => void'
!!! error TS2420: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'.
!!! error TS2420: Type '{ a: string; }' is not assignable to type '{ a: number; }'.
!!! error TS2420: Types of property 'a' are incompatible.
!!! error TS2420: Type 'string' is not assignable to type 'number'.
f(a: T): void { }
}
var x = new X<{ a: string }>();
@@ -37,8 +40,9 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322
!!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'.
!!! error TS2322: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'.
!!! error TS2322: Types of property 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(a: { a: number; }): void' has no corresponding signature in '(a: { a: string; }) => void'
!!! error TS2322: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'.
!!! error TS2322: Types of property 'a' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -2,7 +2,8 @@ tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C<Y>' is not assigna
Type 'Y' is not assignable to type 'X'.
Types of property 'f' are incompatible.
Type '() => boolean' is not assignable to type '() => string'.
Type 'boolean' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => boolean'
Type 'boolean' is not assignable to type 'string'.
==== tests/cases/compiler/generics4.ts (1 errors) ====
@@ -18,4 +19,5 @@ tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C<Y>' is not assigna
!!! error TS2322: Type 'Y' is not assignable to type 'X'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '() => boolean' is not assignable to type '() => string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => boolean'
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
@@ -1,12 +1,14 @@
tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2420: Class 'C<T>' incorrectly implements interface 'IFoo<T>'.
Types of property 'foo' are incompatible.
Type '(x: string) => number' is not assignable to type '(x: T) => T'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'T'.
Signature '(x: T): T' has no corresponding signature in '(x: string) => number'
Types of parameters 'x' and 'x' are incompatible.
Type 'string' is not assignable to type 'T'.
tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: Class 'C2<T>' incorrectly implements interface 'IFoo2<T>'.
Types of property 'foo' are incompatible.
Type '<Tstring>(x: Tstring) => number' is not assignable to type '(x: T) => T'.
Type 'number' is not assignable to type 'T'.
Signature '(x: T): T' has no corresponding signature in '<Tstring>(x: Tstring) => number'
Type 'number' is not assignable to type 'T'.
==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ====
@@ -21,8 +23,9 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420:
!!! error TS2420: Class 'C<T>' incorrectly implements interface 'IFoo<T>'.
!!! error TS2420: Types of property 'foo' are incompatible.
!!! error TS2420: Type '(x: string) => number' is not assignable to type '(x: T) => T'.
!!! error TS2420: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2420: Type 'string' is not assignable to type 'T'.
!!! error TS2420: Signature '(x: T): T' has no corresponding signature in '(x: string) => number'
!!! error TS2420: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2420: Type 'string' is not assignable to type 'T'.
foo(x: string): number {
return null;
}
@@ -36,7 +39,8 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420:
!!! error TS2420: Class 'C2<T>' incorrectly implements interface 'IFoo2<T>'.
!!! error TS2420: Types of property 'foo' are incompatible.
!!! error TS2420: Type '<Tstring>(x: Tstring) => number' is not assignable to type '(x: T) => T'.
!!! error TS2420: Type 'number' is not assignable to type 'T'.
!!! error TS2420: Signature '(x: T): T' has no corresponding signature in '<Tstring>(x: Tstring) => number'
!!! error TS2420: Type 'number' is not assignable to type 'T'.
foo<Tstring>(x: Tstring): number {
return null;
}
@@ -1,12 +1,14 @@
tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'.
Types of property 'p1' are incompatible.
Type '() => string' is not assignable to type '() => number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'.
Types of property 'p1' are incompatible.
Type '(n: number) => number' is not assignable to type '(s: string) => number'.
Types of parameters 'n' and 's' are incompatible.
Type 'number' is not assignable to type 'string'.
Signature '(s: string): number' has no corresponding signature in '(n: number) => number'
Types of parameters 'n' and 's' are incompatible.
Type 'number' is not assignable to type 'string'.
tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'.
Types of property 'p1' are incompatible.
Type 'number' is not assignable to type 'string'.
@@ -17,13 +19,16 @@ tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2420: Class 'C4' incorr
tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
Types of property 'p1' are incompatible.
Type '() => string' is not assignable to type '(s: string) => number'.
Type 'string' is not assignable to type 'number'.
Signature '(s: string): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'.
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'.
Signature '(): string' has no corresponding signature in 'Number'
tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'.
Signature '(): any' has no corresponding signature in '(a: any) => number'
==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ====
@@ -36,7 +41,8 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
!!! error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'.
!!! error TS2420: Types of property 'p1' are incompatible.
!!! error TS2420: Type '() => string' is not assignable to type '() => number'.
!!! error TS2420: Type 'string' is not assignable to type 'number'.
!!! error TS2420: Signature '(): number' has no corresponding signature in '() => string'
!!! error TS2420: Type 'string' is not assignable to type 'number'.
public p1() {
return "s";
}
@@ -51,8 +57,9 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'.
!!! error TS2420: Types of property 'p1' are incompatible.
!!! error TS2420: Type '(n: number) => number' is not assignable to type '(s: string) => number'.
!!! error TS2420: Types of parameters 'n' and 's' are incompatible.
!!! error TS2420: Type 'number' is not assignable to type 'string'.
!!! error TS2420: Signature '(s: string): number' has no corresponding signature in '(n: number) => number'
!!! error TS2420: Types of parameters 'n' and 's' are incompatible.
!!! error TS2420: Type 'number' is not assignable to type 'string'.
public p1(n:number) {
return 0;
}
@@ -93,7 +100,8 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
!!! error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
!!! error TS2345: Types of property 'p1' are incompatible.
!!! error TS2345: Type '() => string' is not assignable to type '(s: string) => number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
!!! error TS2345: Signature '(s: string): number' has no corresponding signature in '() => string'
!!! error TS2345: Type 'string' is not assignable to type 'number'.
function of1(n: { a: { a: string; }; b: string; }): number;
@@ -132,8 +140,10 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
var i1c1: { (): string; } = 5;
~~~~
!!! error TS2322: Type 'number' is not assignable to type '() => string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in 'Number'
var fp1: () =>any = a => 0;
~~~
!!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'.
!!! error TS2322: Signature '(): any' has no corresponding signature in '(a: any) => number'
@@ -1,6 +1,7 @@
tests/cases/compiler/inheritance.ts(30,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'.
Types of property 'g' are incompatible.
Type '(n: number) => number' is not assignable to type '() => number'.
Signature '(): number' has no corresponding signature in '(n: number) => number'
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.
@@ -39,6 +40,7 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines i
!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'.
!!! error TS2415: Types of property 'g' are incompatible.
!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'.
!!! error TS2415: Signature '(): number' has no corresponding signature in '(n: number) => number'
public f(): number { return 0; }
~
!!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
@@ -1,6 +1,7 @@
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '() => string'.
Signature '(): string' has no corresponding signature in 'String'
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor.
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -18,6 +19,7 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error T
!!! error TS2415: Class 'b' incorrectly extends base class 'a'.
!!! error TS2415: Types of property 'x' are incompatible.
!!! error TS2415: Type 'string' is not assignable to type '() => string'.
!!! error TS2415: Signature '(): string' has no corresponding signature in 'String'
get x() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1,6 +1,7 @@
tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '() => string'.
Signature '(): string' has no corresponding signature in 'String'
tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -17,6 +18,7 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error
!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'.
!!! error TS2417: Types of property 'x' are incompatible.
!!! error TS2417: Type 'string' is not assignable to type '() => string'.
!!! error TS2417: Signature '(): string' has no corresponding signature in 'String'
static get x() {
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1,6 +1,7 @@
tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type '() => string'.
Signature '(): string' has no corresponding signature in 'String'
==== tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts (1 errors) ====
@@ -15,5 +16,6 @@ tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS
!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'.
!!! error TS2417: Types of property 'x' are incompatible.
!!! error TS2417: Type 'string' is not assignable to type '() => string'.
!!! error TS2417: Signature '(): string' has no corresponding signature in 'String'
static x: string;
}
@@ -1,7 +1,8 @@
tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'.
Types of property 'foo' are incompatible.
Type '() => number' is not assignable to type '() => string'.
Type 'number' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => number'
Type 'number' is not assignable to type 'string'.
==== tests/cases/compiler/inheritedModuleMembersForClodule.ts (1 errors) ====
@@ -16,7 +17,8 @@ tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Cla
!!! error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'.
!!! error TS2417: Types of property 'foo' are incompatible.
!!! error TS2417: Type '() => number' is not assignable to type '() => string'.
!!! error TS2417: Type 'number' is not assignable to type 'string'.
!!! error TS2417: Signature '(): string' has no corresponding signature in '() => number'
!!! error TS2417: Type 'number' is not assignable to type 'string'.
}
module D {
@@ -1,5 +1,6 @@
tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'.
Type 'void' is not assignable to type 'number'.
Signature '(x: number): number' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'number'.
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts (1 errors) ====
@@ -12,7 +13,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara
C.prototype.bar = () => { } // error
~~~~~~~~~~~~~~~
!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'.
!!! error TS2322: Type 'void' is not assignable to type 'number'.
!!! error TS2322: Signature '(x: number): number' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'number'.
C.prototype.bar = (x) => x; // ok
C.prototype.bar = (x: number) => 1; // ok
return 1;
@@ -14,18 +14,27 @@ tests/cases/compiler/intTypeCheck.ts(106,20): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(106,21): error TS2304: Cannot find name 'i1'.
tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(112,5): error TS2322: Type '{}' is not assignable to type 'i2'.
Signature '(): any' has no corresponding signature in '{}'
tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Object' is not assignable to type 'i2'.
Signature '(): any' has no corresponding signature in 'Object'
tests/cases/compiler/intTypeCheck.ts(114,17): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/intTypeCheck.ts(115,5): error TS2322: Type 'Base' is not assignable to type 'i2'.
Signature '(): any' has no corresponding signature in 'Base'
tests/cases/compiler/intTypeCheck.ts(120,5): error TS2322: Type 'boolean' is not assignable to type 'i2'.
Signature '(): any' has no corresponding signature in 'Boolean'
tests/cases/compiler/intTypeCheck.ts(120,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(120,22): error TS2304: Cannot find name 'i2'.
tests/cases/compiler/intTypeCheck.ts(121,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(126,5): error TS2322: Type '{}' is not assignable to type 'i3'.
Signature 'new (): any' has no corresponding signature in '{}'
tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Object' is not assignable to type 'i3'.
Signature 'new (): any' has no corresponding signature in 'Object'
tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type 'Base' is not assignable to type 'i3'.
Signature 'new (): any' has no corresponding signature in 'Base'
tests/cases/compiler/intTypeCheck.ts(131,5): error TS2322: Type '() => void' is not assignable to type 'i3'.
Signature 'new (): any' has no corresponding signature in '() => void'
tests/cases/compiler/intTypeCheck.ts(134,5): error TS2322: Type 'boolean' is not assignable to type 'i3'.
Signature 'new (): any' has no corresponding signature in 'Boolean'
tests/cases/compiler/intTypeCheck.ts(134,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3'.
tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
@@ -50,20 +59,30 @@ tests/cases/compiler/intTypeCheck.ts(162,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(162,22): error TS2304: Cannot find name 'i5'.
tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(168,5): error TS2322: Type '{}' is not assignable to type 'i6'.
Signature '(): any' has no corresponding signature in '{}'
tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Object' is not assignable to type 'i6'.
Signature '(): any' has no corresponding signature in 'Object'
tests/cases/compiler/intTypeCheck.ts(170,17): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type 'Base' is not assignable to type 'i6'.
Signature '(): any' has no corresponding signature in 'Base'
tests/cases/compiler/intTypeCheck.ts(173,5): error TS2322: Type '() => void' is not assignable to type 'i6'.
Type 'void' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'number'.
tests/cases/compiler/intTypeCheck.ts(176,5): error TS2322: Type 'boolean' is not assignable to type 'i6'.
Signature '(): any' has no corresponding signature in 'Boolean'
tests/cases/compiler/intTypeCheck.ts(176,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(176,22): error TS2304: Cannot find name 'i6'.
tests/cases/compiler/intTypeCheck.ts(177,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(182,5): error TS2322: Type '{}' is not assignable to type 'i7'.
Signature 'new (): any' has no corresponding signature in '{}'
tests/cases/compiler/intTypeCheck.ts(183,5): error TS2322: Type 'Object' is not assignable to type 'i7'.
Signature 'new (): any' has no corresponding signature in 'Object'
tests/cases/compiler/intTypeCheck.ts(185,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other.
Signature 'new (): any' has no corresponding signature in 'Base'
tests/cases/compiler/intTypeCheck.ts(187,5): error TS2322: Type '() => void' is not assignable to type 'i7'.
Signature 'new (): any' has no corresponding signature in '() => void'
tests/cases/compiler/intTypeCheck.ts(190,5): error TS2322: Type 'boolean' is not assignable to type 'i7'.
Signature 'new (): any' has no corresponding signature in 'Boolean'
tests/cases/compiler/intTypeCheck.ts(190,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7'.
tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
@@ -216,15 +235,18 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj12: i2 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i2'.
!!! error TS2322: Signature '(): any' has no corresponding signature in '{}'
var obj13: i2 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i2'.
!!! error TS2322: Signature '(): any' has no corresponding signature in 'Object'
var obj14: i2 = new obj11;
~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
var obj15: i2 = new Base;
~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'i2'.
!!! error TS2322: Signature '(): any' has no corresponding signature in 'Base'
var obj16: i2 = null;
var obj17: i2 = function ():any { return 0; };
//var obj18: i2 = function foo() { };
@@ -232,6 +254,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj20: i2 = new <i2> anyVar;
~~~~~
!!! error TS2322: Type 'boolean' is not assignable to type 'i2'.
!!! error TS2322: Signature '(): any' has no corresponding signature in 'Boolean'
~
!!! error TS1109: Expression expected.
~~
@@ -246,22 +269,27 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj23: i3 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i3'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in '{}'
var obj24: i3 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i3'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Object'
var obj25: i3 = new obj22;
var obj26: i3 = new Base;
~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'i3'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Base'
var obj27: i3 = null;
var obj28: i3 = function () { };
~~~~~
!!! error TS2322: Type '() => void' is not assignable to type 'i3'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in '() => void'
//var obj29: i3 = function foo() { };
var obj30: i3 = <i3> anyVar;
var obj31: i3 = new <i3> anyVar;
~~~~~
!!! error TS2322: Type 'boolean' is not assignable to type 'i3'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Boolean'
~
!!! error TS1109: Expression expected.
~~
@@ -338,25 +366,30 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj56: i6 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i6'.
!!! error TS2322: Signature '(): any' has no corresponding signature in '{}'
var obj57: i6 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i6'.
!!! error TS2322: Signature '(): any' has no corresponding signature in 'Object'
var obj58: i6 = new obj55;
~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
var obj59: i6 = new Base;
~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'i6'.
!!! error TS2322: Signature '(): any' has no corresponding signature in 'Base'
var obj60: i6 = null;
var obj61: i6 = function () { };
~~~~~
!!! error TS2322: Type '() => void' is not assignable to type 'i6'.
!!! error TS2322: Type 'void' is not assignable to type 'number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'number'.
//var obj62: i6 = function foo() { };
var obj63: i6 = <i6> anyVar;
var obj64: i6 = new <i6> anyVar;
~~~~~
!!! error TS2322: Type 'boolean' is not assignable to type 'i6'.
!!! error TS2322: Signature '(): any' has no corresponding signature in 'Boolean'
~
!!! error TS1109: Expression expected.
~~
@@ -371,22 +404,27 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj67: i7 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i7'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in '{}'
var obj68: i7 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i7'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Object'
var obj69: i7 = new obj66;
var obj70: i7 = <i7>new Base;
~~~~~~~~~~~~
!!! error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other.
!!! error TS2352: Signature 'new (): any' has no corresponding signature in 'Base'
var obj71: i7 = null;
var obj72: i7 = function () { };
~~~~~
!!! error TS2322: Type '() => void' is not assignable to type 'i7'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in '() => void'
//var obj73: i7 = function foo() { };
var obj74: i7 = <i7> anyVar;
var obj75: i7 = new <i7> anyVar;
~~~~~
!!! error TS2322: Type 'boolean' is not assignable to type 'i7'.
!!! error TS2322: Signature 'new (): any' has no corresponding signature in 'Boolean'
~
!!! error TS1109: Expression expected.
~~
@@ -1,7 +1,8 @@
tests/cases/compiler/interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'.
Types of parameters 'a' and 'a' are incompatible.
Type 'IFrenchEye' is not assignable to type 'IEye'.
Property 'color' is missing in type 'IFrenchEye'.
Signature '(a: IEye, b: IEye): number' has no corresponding signature in '(a: IFrenchEye, b: IFrenchEye) => number'
Types of parameters 'a' and 'a' are incompatible.
Type 'IFrenchEye' is not assignable to type 'IEye'.
Property 'color' is missing in type 'IFrenchEye'.
tests/cases/compiler/interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'.
tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'.
Property 'coleur' is missing in type 'IEye'.
@@ -44,9 +45,10 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEy
x=x.sort(CompareYeux); // parameter mismatch
~~~~~~~~~~~
!!! error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'.
!!! error TS2345: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2345: Type 'IFrenchEye' is not assignable to type 'IEye'.
!!! error TS2345: Property 'color' is missing in type 'IFrenchEye'.
!!! error TS2345: Signature '(a: IEye, b: IEye): number' has no corresponding signature in '(a: IFrenchEye, b: IFrenchEye) => number'
!!! error TS2345: Types of parameters 'a' and 'a' are incompatible.
!!! error TS2345: Type 'IFrenchEye' is not assignable to type 'IEye'.
!!! error TS2345: Property 'color' is missing in type 'IFrenchEye'.
// type of z inferred from specialized array type
var z=x.sort(CompareEyes); // ok
@@ -3,6 +3,7 @@ tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1'
tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'.
Property 'iFn' is private in type 'C1' but not in type 'I2'.
tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() => C2' is not assignable to type 'I4'.
Signature 'new (): I3' has no corresponding signature in '() => C2'
==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ====
@@ -48,6 +49,7 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() =
var a:I4 = function(){
~
!!! error TS2322: Type '() => C2' is not assignable to type 'I4'.
!!! error TS2322: Signature 'new (): I3' has no corresponding signature in '() => C2'
return new C2();
}
new a();
@@ -3,8 +3,9 @@ tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface
tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'.
Types of property 'name' are incompatible.
Type '() => string' is not assignable to type '() => { s: string; n: number; }'.
Type 'string' is not assignable to type '{ s: string; n: number; }'.
Property 's' is missing in type 'String'.
Signature '(): { s: string; n: number; }' has no corresponding signature in '() => string'
Type 'string' is not assignable to type '{ s: string; n: number; }'.
Property 's' is missing in type 'String'.
==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ====
@@ -22,8 +23,9 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1'
!!! error TS2420: Class 'C1' incorrectly implements interface 'i4'.
!!! error TS2420: Types of property 'name' are incompatible.
!!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'.
!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'.
!!! error TS2420: Property 's' is missing in type 'String'.
!!! error TS2420: Signature '(): { s: string; n: number; }' has no corresponding signature in '() => string'
!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'.
!!! error TS2420: Property 's' is missing in type 'String'.
public name(): string { return ""; }
}
@@ -7,6 +7,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'.
Property 'bar' is missing in type 'Boolean'.
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'.
Signature '(): string' has no corresponding signature in 'Boolean'
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'.
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2364: Invalid left-hand side of assignment expression.
@@ -46,6 +47,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26
var h: { (): string } = x;
~
!!! error TS2322: Type 'boolean' is not assignable to type '() => string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in 'Boolean'
var h2: { toString(): string } = x; // no error
module M { export var a = 1; }
@@ -1,11 +1,13 @@
tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable<symbol>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => SymbolIterator' is not assignable to type '() => Iterator<symbol>'.
Type 'SymbolIterator' is not assignable to type 'Iterator<symbol>'.
Types of property 'next' are incompatible.
Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult<symbol>'.
Type '{ value: symbol; }' is not assignable to type 'IteratorResult<symbol>'.
Property 'done' is missing in type '{ value: symbol; }'.
Signature '(): Iterator<symbol>' has no corresponding signature in '() => SymbolIterator'
Type 'SymbolIterator' is not assignable to type 'Iterator<symbol>'.
Types of property 'next' are incompatible.
Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult<symbol>'.
Signature '(value?: any): IteratorResult<symbol>' has no corresponding signature in '() => { value: symbol; }'
Type '{ value: symbol; }' is not assignable to type 'IteratorResult<symbol>'.
Property 'done' is missing in type '{ value: symbol; }'.
==== tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts (1 errors) ====
@@ -14,11 +16,13 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray9.ts(1,17): error TS2322
!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterable<symbol>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => SymbolIterator' is not assignable to type '() => Iterator<symbol>'.
!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator<symbol>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult<symbol>'.
!!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult<symbol>'.
!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'.
!!! error TS2322: Signature '(): Iterator<symbol>' has no corresponding signature in '() => SymbolIterator'
!!! error TS2322: Type 'SymbolIterator' is not assignable to type 'Iterator<symbol>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: symbol; }' is not assignable to type '(value?: any) => IteratorResult<symbol>'.
!!! error TS2322: Signature '(value?: any): IteratorResult<symbol>' has no corresponding signature in '() => { value: symbol; }'
!!! error TS2322: Type '{ value: symbol; }' is not assignable to type 'IteratorResult<symbol>'.
!!! error TS2322: Property 'done' is missing in type '{ value: symbol; }'.
class SymbolIterator {
next() {
@@ -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: any) => void' is not assignable to parameter of type '() => any'.
Signature '(): any' has no corresponding signature in '(items: any) => void'
==== 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: any) => void' is not assignable to parameter of type '() => any'.
!!! error TS2345: Signature '(): any' has no corresponding signature in '(items: any) => void'
}
@@ -3,6 +3,7 @@ tests/cases/compiler/multipleInheritance.ts(18,21): error TS1174: Classes can on
tests/cases/compiler/multipleInheritance.ts(34,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'.
Types of property 'g' are incompatible.
Type '(n: number) => number' is not assignable to type '() => number'.
Signature '(): number' has no corresponding signature in '(n: number) => number'
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.
@@ -49,6 +50,7 @@ tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' d
!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'.
!!! error TS2415: Types of property 'g' are incompatible.
!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'.
!!! error TS2415: Signature '(): number' has no corresponding signature in '(n: number) => number'
public f(): number { return 0; }
~
!!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
@@ -1,15 +1,18 @@
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'string'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'string'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'string'.
==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts (3 errors) ====
@@ -24,7 +27,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
!!! error TS2322: Type 'I' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => void' is not assignable to type '() => string'.
!!! error TS2322: Type 'void' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'string'.
i = o; // ok
class C {
@@ -36,7 +40,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
!!! error TS2322: Type 'C' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => void' is not assignable to type '() => string'.
!!! error TS2322: Type 'void' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'string'.
c = o; // ok
var a = {
@@ -47,5 +52,6 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => void' is not assignable to type '() => string'.
!!! error TS2322: Type 'void' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'string'.
a = o; // ok
@@ -1,23 +1,28 @@
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => number' is not assignable to type '() => string'.
Type 'number' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => number'
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
Types of property 'toString' are incompatible.
Type '() => string' is not assignable to type '() => number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => number' is not assignable to type '() => string'.
Type 'number' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => number'
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C'.
Types of property 'toString' are incompatible.
Type '() => string' is not assignable to type '() => number'.
Type 'string' is not assignable to type 'number'.
Signature '(): number' has no corresponding signature in '() => string'
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'.
Types of property 'toString' are incompatible.
Type '() => void' is not assignable to type '() => string'.
Type 'void' is not assignable to type 'string'.
Signature '(): string' has no corresponding signature in '() => void'
Type 'void' is not assignable to type 'string'.
==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts (5 errors) ====
@@ -32,13 +37,15 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
!!! error TS2322: Type 'I' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => number' is not assignable to type '() => string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => number'
!!! error TS2322: Type 'number' is not assignable to type 'string'.
i = o; // error
~
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => string' is not assignable to type '() => number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '() => string'
!!! error TS2322: Type 'string' is not assignable to type 'number'.
class C {
toString(): number { return 1; }
@@ -49,13 +56,15 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
!!! error TS2322: Type 'C' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => number' is not assignable to type '() => string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => number'
!!! error TS2322: Type 'number' is not assignable to type 'string'.
c = o; // error
~
!!! error TS2322: Type 'Object' is not assignable to type 'C'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => string' is not assignable to type '() => number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! error TS2322: Signature '(): number' has no corresponding signature in '() => string'
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var a = {
toString: () => { }
@@ -65,5 +74,6 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC
!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'.
!!! error TS2322: Types of property 'toString' are incompatible.
!!! error TS2322: Type '() => void' is not assignable to type '() => string'.
!!! error TS2322: Type 'void' is not assignable to type 'string'.
!!! error TS2322: Signature '(): string' has no corresponding signature in '() => void'
!!! error TS2322: Type 'void' is not assignable to type 'string'.
a = o; // ok
@@ -1,5 +1,7 @@
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
Signature '(): void' has no corresponding signature in 'Object'
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'.
Signature '(): void' has no corresponding signature in 'Object'
==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ====
@@ -13,6 +15,7 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf
i = f;
~
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
!!! error TS2322: Signature '(): void' has no corresponding signature in 'Object'
var a: {
(): void
@@ -20,4 +23,5 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf
f = a;
a = f;
~
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
!!! error TS2322: Signature '(): void' has no corresponding signature in 'Object'

Some files were not shown because too many files have changed in this diff Show More