mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix 33436 (#35225)
* Fix 33436 * Fix code * Fix error message after bad merge * Remove whitespace
This commit is contained in:
+18
-7
@@ -15218,13 +15218,24 @@ namespace ts {
|
||||
if (incompatibleStack.length) reportIncompatibleStack();
|
||||
const [sourceType, targetType] = getTypeNamesForErrorDisplay(source, target);
|
||||
|
||||
if (target.flags & TypeFlags.TypeParameter && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) {
|
||||
reportError(
|
||||
Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,
|
||||
sourceType,
|
||||
targetType,
|
||||
typeToString(target.immediateBaseConstraint),
|
||||
);
|
||||
if (target.flags & TypeFlags.TypeParameter) {
|
||||
const constraint = getBaseConstraintOfType(target);
|
||||
const constraintElab = constraint && isTypeAssignableTo(source, constraint);
|
||||
if (constraintElab) {
|
||||
reportError(
|
||||
Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,
|
||||
sourceType,
|
||||
targetType,
|
||||
typeToString(constraint!),
|
||||
);
|
||||
}
|
||||
else {
|
||||
reportError(
|
||||
Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,
|
||||
targetType,
|
||||
sourceType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!message) {
|
||||
|
||||
@@ -3445,6 +3445,10 @@
|
||||
"category": "Error",
|
||||
"code": 5081
|
||||
},
|
||||
"'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 5082
|
||||
},
|
||||
|
||||
"Generates a sourcemap for each corresponding '.d.ts' file.": {
|
||||
"category": "Message",
|
||||
|
||||
@@ -14,7 +14,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(62,1): error TS2322: Type '(x: (arg: Base) => Derived) => Base' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
@@ -143,7 +143,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
var b6: <T extends Base, U extends Derived>(x: (arg: T) => U) => T;
|
||||
a6 = b6; // ok
|
||||
b6 = a6; // ok
|
||||
|
||||
@@ -19,10 +19,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(58,9): error TS2322: Type '(...x: Base[]) => Base' is not assignable to type '<T extends Derived>(...x: T[]) => T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(62,9): error TS2322: Type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type '<T extends Derived>(x: T, y: T) => T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(66,9): error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '<T extends Derived2[]>(x: Base[], y: Base[]) => T'.
|
||||
Type 'Derived[]' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(69,9): error TS2322: Type '<T>(x: { a: T; b: T; }) => T' is not assignable to type '(x: { a: string; b: number; }) => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: string; b: number; }' is not assignable to type '{ a: string; b: string; }'.
|
||||
@@ -47,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(89,9): error TS2322: Type '<T>(x: T) => string[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(90,9): error TS2322: Type '<T>(x: T) => T[]' is not assignable to type '<T>(x: T) => string[]'.
|
||||
Type 'T[]' is not assignable to type 'string[]'.
|
||||
Type 'T' is not assignable to type 'string'.
|
||||
@@ -57,7 +60,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '<T>(x: T) => string[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (15 errors) ====
|
||||
@@ -145,6 +148,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type '(...x: Base[]) => Base' is not assignable to type '<T extends Derived>(...x: T[]) => T'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
var b11: <T extends Derived>(x: T, y: T) => T;
|
||||
a11 = b11;
|
||||
@@ -152,6 +156,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type '<T extends Derived>(x: T, y: T) => T'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
var b12: <T extends Array<Derived2>>(x: Array<Base>, y: Array<Base>) => T;
|
||||
a12 = b12;
|
||||
@@ -159,6 +164,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '<T extends Derived2[]>(x: Base[], y: Base[]) => T'.
|
||||
!!! error TS2322: Type 'Derived[]' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'.
|
||||
|
||||
var b15: <T>(x: { a: T; b: T }) => T;
|
||||
a15 = b15;
|
||||
@@ -211,7 +217,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '<T>(x: T) => string[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
!!! error TS2322: Type 'string[]' is not assignable to type 'T[]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
b2 = a2;
|
||||
~~
|
||||
!!! error TS2322: Type '<T>(x: T) => T[]' is not assignable to type '<T>(x: T) => string[]'.
|
||||
@@ -231,6 +237,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '<T>(x: T) => string[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
!!! error TS2322: Type 'string[]' is not assignable to type 'T[]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,18 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts(40,1): error TS2322: Type '<T>(x: T) => void' is not assignable to type '<T>(x: T) => T'.
|
||||
Type 'void' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts(52,1): error TS2322: Type '<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base' is not assignable to type '<T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts(55,1): error TS2322: Type '<T>(x: { a: T; b: T; }) => T[]' is not assignable to type '<U, V>(x: { a: U; b: V; }) => U[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: U; b: V; }' is not assignable to type '{ a: U; b: U; }'.
|
||||
Types of property 'b' are incompatible.
|
||||
Type 'V' is not assignable to type 'U'.
|
||||
'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts(58,1): error TS2322: Type '<T extends Base>(x: { a: T; b: T; }) => T[]' is not assignable to type '<U, V>(x: { a: U; b: V; }) => U[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: U; b: V; }' is not assignable to type '{ a: Base; b: Base; }'.
|
||||
@@ -63,6 +64,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~
|
||||
!!! error TS2322: Type '<T>(x: T) => void' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'void' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
var b4: <T, U>(x: T, y: U) => string;
|
||||
a4 = b4; // ok
|
||||
b4 = a4; // ok
|
||||
@@ -81,7 +83,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
!!! error TS2322: Types of property 'foo' are incompatible.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
var b15: <U, V>(x: { a: U; b: V; }) => U[];
|
||||
a15 = b15; // ok, T = U, T = V
|
||||
b15 = a15; // ok
|
||||
@@ -91,7 +93,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ a: U; b: V; }' is not assignable to type '{ a: U; b: U; }'.
|
||||
!!! error TS2322: Types of property 'b' are incompatible.
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
var b16: <T>(x: { a: T; b: T }) => T[];
|
||||
a15 = b16; // ok
|
||||
b15 = a16; // ok
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures6.ts(30,1): error TS2322: Type '<T>(x: T) => void' is not assignable to type '<T>(x: T) => T'.
|
||||
Type 'void' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures6.ts(39,1): error TS2322: Type '<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base' is not assignable to type '<T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures6.ts(42,1): error TS2322: Type '<T extends Base>(x: { a: T; b: T; }) => T[]' is not assignable to type '<T>(x: { a: T; b: T; }) => T[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: T; b: T; }' is not assignable to type '{ a: Base; b: Base; }'.
|
||||
@@ -47,6 +48,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~
|
||||
!!! error TS2322: Type '<T>(x: T) => void' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'void' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
var b4: <T, U>(x: T, y: U) => string;
|
||||
x.a4 = b4;
|
||||
b4 = x.a4;
|
||||
@@ -62,7 +64,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
!!! error TS2322: Types of property 'foo' are incompatible.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
var b16: <T>(x: { a: T; b: T }) => T[];
|
||||
x.a16 = b16;
|
||||
b16 = x.a16;
|
||||
|
||||
@@ -14,7 +14,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(62,1): error TS2322: Type 'new (x: (arg: Base) => Derived) => Base' is not assignable to type 'new <T extends Base, U extends Derived>(x: (arg: T) => U) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
@@ -143,7 +143,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
var b6: new <T extends Base, U extends Derived>(x: (arg: T) => U) => T;
|
||||
a6 = b6; // ok
|
||||
b6 = a6; // ok
|
||||
|
||||
@@ -19,10 +19,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(58,9): error TS2322: Type 'new (...x: Base[]) => Base' is not assignable to type 'new <T extends Derived>(...x: T[]) => T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(62,9): error TS2322: Type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type 'new <T extends Derived>(x: T, y: T) => T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(66,9): error TS2322: Type 'new (x: Base[], y: Derived2[]) => Derived[]' is not assignable to type 'new <T extends Derived2[]>(x: Base[], y: Base[]) => T'.
|
||||
Type 'Derived[]' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(69,9): error TS2322: Type 'new <T>(x: { a: T; b: T; }) => T' is not assignable to type 'new (x: { a: string; b: number; }) => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: string; b: number; }' is not assignable to type '{ a: string; b: string; }'.
|
||||
@@ -63,7 +66,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(89,9): error TS2322: Type 'new <T>(x: T) => string[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(90,9): error TS2322: Type 'new <T>(x: T) => T[]' is not assignable to type 'new <T>(x: T) => string[]'.
|
||||
Type 'T[]' is not assignable to type 'string[]'.
|
||||
Type 'T' is not assignable to type 'string'.
|
||||
@@ -73,7 +76,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new <T>(x: T) => string[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (19 errors) ====
|
||||
@@ -161,6 +164,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type 'new (...x: Base[]) => Base' is not assignable to type 'new <T extends Derived>(...x: T[]) => T'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
var b11: new <T extends Derived>(x: T, y: T) => T;
|
||||
a11 = b11; // ok
|
||||
@@ -168,6 +172,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type 'new <T extends Derived>(x: T, y: T) => T'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
var b12: new <T extends Array<Derived2>>(x: Array<Base>, y: Array<Base>) => T;
|
||||
a12 = b12; // ok
|
||||
@@ -175,6 +180,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type 'new (x: Base[], y: Derived2[]) => Derived[]' is not assignable to type 'new <T extends Derived2[]>(x: Base[], y: Base[]) => T'.
|
||||
!!! error TS2322: Type 'Derived[]' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'.
|
||||
|
||||
var b15: new <T>(x: { a: T; b: T }) => T;
|
||||
a15 = b15; // ok
|
||||
@@ -247,7 +253,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'new <T>(x: T) => string[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
!!! error TS2322: Type 'string[]' is not assignable to type 'T[]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
b2 = a2; // ok
|
||||
~~
|
||||
!!! error TS2322: Type 'new <T>(x: T) => T[]' is not assignable to type 'new <T>(x: T) => string[]'.
|
||||
@@ -267,6 +273,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'new <T>(x: T) => string[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
!!! error TS2322: Type 'string[]' is not assignable to type 'T[]'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,18 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures5.ts(40,1): error TS2322: Type 'new <T>(x: T) => void' is not assignable to type 'new <T>(x: T) => T'.
|
||||
Type 'void' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures5.ts(52,1): error TS2322: Type 'new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base' is not assignable to type 'new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures5.ts(55,1): error TS2322: Type 'new <T>(x: { a: T; b: T; }) => T[]' is not assignable to type 'new <U, V>(x: { a: U; b: V; }) => U[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: U; b: V; }' is not assignable to type '{ a: U; b: U; }'.
|
||||
Types of property 'b' are incompatible.
|
||||
Type 'V' is not assignable to type 'U'.
|
||||
'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures5.ts(58,1): error TS2322: Type 'new <T extends Base>(x: { a: T; b: T; }) => T[]' is not assignable to type 'new <U, V>(x: { a: U; b: V; }) => U[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: U; b: V; }' is not assignable to type '{ a: Base; b: Base; }'.
|
||||
@@ -63,6 +64,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~
|
||||
!!! error TS2322: Type 'new <T>(x: T) => void' is not assignable to type 'new <T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'void' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
var b4: new <T, U>(x: T, y: U) => string;
|
||||
a4 = b4; // ok
|
||||
b4 = a4; // ok
|
||||
@@ -81,7 +83,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
!!! error TS2322: Types of property 'foo' are incompatible.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
var b15: new <U, V>(x: { a: U; b: V; }) => U[];
|
||||
a15 = b15; // ok
|
||||
b15 = a15; // ok
|
||||
@@ -91,7 +93,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ a: U; b: V; }' is not assignable to type '{ a: U; b: U; }'.
|
||||
!!! error TS2322: Types of property 'b' are incompatible.
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
var b16: new <T>(x: { a: T; b: T }) => T[];
|
||||
a15 = b16; // ok
|
||||
b15 = a16; // ok
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures6.ts(30,1): error TS2322: Type 'new <T>(x: T) => void' is not assignable to type 'new <T>(x: T) => T'.
|
||||
Type 'void' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures6.ts(39,1): error TS2322: Type 'new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base' is not assignable to type 'new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures6.ts(42,1): error TS2322: Type 'new <T extends Base>(x: { a: T; b: T; }) => T[]' is not assignable to type 'new <T>(x: { a: T; b: T; }) => T[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type '{ a: T; b: T; }' is not assignable to type '{ a: Base; b: Base; }'.
|
||||
@@ -47,6 +48,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~
|
||||
!!! error TS2322: Type 'new <T>(x: T) => void' is not assignable to type 'new <T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'void' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
var b4: new <T, U>(x: T, y: U) => string;
|
||||
x.a4 = b4;
|
||||
b4 = x.a4;
|
||||
@@ -62,7 +64,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ foo: U; bar: U; }' is not assignable to type '{ foo: T; bar: T; }'.
|
||||
!!! error TS2322: Types of property 'foo' are incompatible.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
var b16: new <T>(x: { a: T; b: T }) => T[];
|
||||
x.a16 = b16;
|
||||
b16 = x.a16;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures2.ts(15,1): error TS2322: Type 'B' is not assignable to type 'A'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type 'T[]' is not assignable to type 'T'.
|
||||
'T[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T[]'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures2.ts(16,1): error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type 'S' is not assignable to type 'S[]'.
|
||||
@@ -27,7 +27,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'B' is not assignable to type 'A'.
|
||||
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
|
||||
!!! error TS2322: Type 'T[]' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T[]'.
|
||||
b = a;
|
||||
~
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
|
||||
@@ -3,6 +3,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
Type 'T' is not assignable to type 'I2<T>'.
|
||||
Type 'I2<I2<T>>' is not assignable to type 'I2<T>'.
|
||||
Type 'I2<T>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'I2<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts (1 errors) ====
|
||||
@@ -24,4 +25,5 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'I2<T>'.
|
||||
!!! error TS2322: Type 'I2<I2<T>>' is not assignable to type 'I2<T>'.
|
||||
!!! error TS2322: Type 'I2<T>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'I2<T>'.
|
||||
|
||||
+46
-46
@@ -2,91 +2,91 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
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'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '<T>() => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(64,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>() => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
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'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(67,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>() => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(69,9): error TS2322: Type '() => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(70,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(71,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(72,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(73,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(75,9): error TS2322: Type '() => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(76,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(77,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(78,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(79,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(81,9): error TS2322: Type '() => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(82,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(83,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(84,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(85,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(87,9): error TS2322: Type '() => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(88,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(89,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(90,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(91,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '<T>(x: T) => any' is not assignable to type '<T>() => T'.
|
||||
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'.
|
||||
|
||||
@@ -162,12 +162,12 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type '() => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a = t.a2;
|
||||
~~~
|
||||
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a = t.a3;
|
||||
~~~
|
||||
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
@@ -178,127 +178,127 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~
|
||||
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>() => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
b.a2 = t.a;
|
||||
~~~~
|
||||
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a2 = t.a2;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a2 = t.a3;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a2 = t.a4;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a2 = t.a5;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
b.a3 = t.a;
|
||||
~~~~
|
||||
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a3 = t.a2;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a3 = t.a3;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a3 = t.a4;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a3 = t.a5;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
b.a4 = t.a;
|
||||
~~~~
|
||||
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a4 = t.a2;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a4 = t.a3;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a4 = t.a4;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a4 = t.a5;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
b.a5 = t.a;
|
||||
~~~~
|
||||
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a5 = t.a2;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a5 = t.a3;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a5 = t.a4;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
b.a5 = t.a5;
|
||||
~~~~
|
||||
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: string; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'string'.
|
||||
@@ -35,6 +36,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A<T>'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
b = a; // error
|
||||
~
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: string; }'.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/assignmentStricterConstraints.ts(7,1): error TS2322: Type '<T, S extends T>(x: T, y: S) => void' is not assignable to type '<T, S>(x: T, y: S) => void'.
|
||||
Types of parameters 'y' and 'y' are incompatible.
|
||||
Type 'S' is not assignable to type 'T'.
|
||||
'S' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'S'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentStricterConstraints.ts (1 errors) ====
|
||||
@@ -16,6 +16,6 @@ tests/cases/compiler/assignmentStricterConstraints.ts(7,1): error TS2322: Type '
|
||||
!!! error TS2322: Type '<T, S extends T>(x: T, y: S) => void' is not assignable to type '<T, S>(x: T, y: S) => void'.
|
||||
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
|
||||
!!! error TS2322: Type 'S' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'S' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'S'.
|
||||
g(1, "")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/baseConstraintOfDecorator.ts(2,5): error TS2322: Type 'typeof decoratorFunc' is not assignable to type 'TFunction'.
|
||||
'typeof decoratorFunc' is assignable to the constraint of type 'TFunction', but 'TFunction' could be instantiated with a different subtype of constraint '{}'.
|
||||
'TFunction' could be instantiated with an arbitrary type which could be unrelated to 'typeof decoratorFunc'.
|
||||
tests/cases/compiler/baseConstraintOfDecorator.ts(2,40): error TS2507: Type 'TFunction' is not a constructor function type.
|
||||
tests/cases/compiler/baseConstraintOfDecorator.ts(12,18): error TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'.
|
||||
|
||||
@@ -22,7 +22,7 @@ tests/cases/compiler/baseConstraintOfDecorator.ts(12,18): error TS2545: A mixin
|
||||
};
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'typeof decoratorFunc' is not assignable to type 'TFunction'.
|
||||
!!! error TS2322: 'typeof decoratorFunc' is assignable to the constraint of type 'TFunction', but 'TFunction' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'TFunction' could be instantiated with an arbitrary type which could be unrelated to 'typeof decoratorFunc'.
|
||||
}
|
||||
|
||||
class MyClass { private x; }
|
||||
|
||||
@@ -4,7 +4,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(63,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts (2 errors) ====
|
||||
@@ -79,7 +79,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
// N's
|
||||
a2: <T>(x: T) => string; // error because base returns non-void;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'number' is not assignable to type 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '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'.
|
||||
@@ -30,7 +30,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7' incorrectly extends interface 'C'.
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'T[]' is not assignable to type 'string[]'.
|
||||
@@ -95,7 +95,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! 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 'number' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: The types returned by 'a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'string[]' is not assignable to type 'T[]'.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
a2: <T>(x: T) => string[]; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -3,32 +3,32 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
Type '(x: T) => T[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts(28,11): error TS2430: Interface 'I2<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type '(x: T) => string[]' is not assignable to type '<T>(x: T) => string[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts(32,11): error TS2430: Interface 'I3<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>(x: T) => void'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts(36,11): error TS2430: Interface 'I4<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type '<U>(x: T, y: U) => string' is not assignable to type '<T, U>(x: T, y: U) => string'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts(40,11): error TS2430: Interface 'I5<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type '<U>(x: (arg: T) => U) => T' is not assignable to type '<T, U>(x: (arg: T) => U) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts(44,11): error TS2430: Interface 'I7<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a11' are incompatible.
|
||||
Type '<U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base' is not assignable to type '<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base'.
|
||||
@@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts(48,11): error TS2430: Interface 'I9<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a16' are incompatible.
|
||||
Type '(x: { a: T; b: T; }) => T[]' is not assignable to type '<T extends Base>(x: { a: T; b: T; }) => T[]'.
|
||||
@@ -44,9 +44,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts (7 errors) ====
|
||||
@@ -80,7 +80,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Type '(x: T) => T[]' is not assignable to type '<T>(x: T) => T[]'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: (x: T) => T[];
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Type '(x: T) => string[]' is not assignable to type '<T>(x: T) => string[]'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: (x: T) => string[];
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '<T>(x: T) => void'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Type '<U>(x: T, y: U) => string' is not assignable to type '<T, U>(x: T, y: U) => string'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: <U>(x: T, y: U) => string;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Types of parameters 'arg' and 'arg' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: <U>(x: (arg: T) => U) => T;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: Types of property 'foo' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a11: <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign
|
||||
!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
a16: (x: { a: T; b: T }) => T[];
|
||||
}
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(7,49): error TS2322: Type 'T' is not assignable to type 'S'.
|
||||
'T' is assignable to the constraint of type 'S', but 'S' could be instantiated with a different subtype of constraint '{}'.
|
||||
'S' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,35): error TS2322: Type 'T' is not assignable to type 'S'.
|
||||
'T' is assignable to the constraint of type 'S', but 'S' could be instantiated with a different subtype of constraint '{}'.
|
||||
'S' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
@@ -17,14 +17,14 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete
|
||||
(new Chain(t)).then(tt => s).then(ss => t);
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'S'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'S', but 'S' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'S' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! related TS6502 tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts:3:27: The expected type comes from the return type of this signature.
|
||||
|
||||
// But error to try to climb up the chain
|
||||
(new Chain(s)).then(ss => t);
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'S'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'S', but 'S' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'S' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! related TS6502 tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts:3:27: The expected type comes from the return type of this signature.
|
||||
|
||||
// Staying at T or S should be fine
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'.
|
||||
'T2' is assignable to the constraint of type 'T1', but 'T1' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T1' could be instantiated with an arbitrary type which could be unrelated to 'T2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ====
|
||||
@@ -20,5 +20,5 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOpera
|
||||
var result: T1 = (x, y); //error here
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'T2' is not assignable to type 'T1'.
|
||||
!!! error TS2322: 'T2' is assignable to the constraint of type 'T1', but 'T1' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T1' could be instantiated with an arbitrary type which could be unrelated to 'T2'.
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
tests/cases/compiler/immutable.ts(341,22): error TS2430: Interface 'Keyed<K, V>' incorrectly extends interface 'Collection<K, V>'.
|
||||
The types returned by 'toSeq()' are incompatible between these types.
|
||||
Type 'Keyed<K, V>' is not assignable to type 'this'.
|
||||
'Keyed<K, V>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Keyed<K, V>'.
|
||||
'this' could be instantiated with an arbitrary type which could be unrelated to 'Keyed<K, V>'.
|
||||
tests/cases/compiler/immutable.ts(359,22): error TS2430: Interface 'Indexed<T>' incorrectly extends interface 'Collection<number, T>'.
|
||||
The types returned by 'toSeq()' are incompatible between these types.
|
||||
Type 'Indexed<T>' is not assignable to type 'this'.
|
||||
'Indexed<T>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Indexed<T>'.
|
||||
'this' could be instantiated with an arbitrary type which could be unrelated to 'Indexed<T>'.
|
||||
tests/cases/compiler/immutable.ts(391,22): error TS2430: Interface 'Set<T>' incorrectly extends interface 'Collection<never, T>'.
|
||||
The types returned by 'toSeq()' are incompatible between these types.
|
||||
Type 'Set<T>' is not assignable to type 'this'.
|
||||
'Set<T>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Set<T>'.
|
||||
'this' could be instantiated with an arbitrary type which could be unrelated to 'Set<T>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/complex.ts (0 errors) ====
|
||||
@@ -379,7 +379,7 @@ tests/cases/compiler/immutable.ts(391,22): error TS2430: Interface 'Set<T>' inco
|
||||
!!! error TS2430: Interface 'Keyed<K, V>' incorrectly extends interface 'Collection<K, V>'.
|
||||
!!! error TS2430: The types returned by 'toSeq()' are incompatible between these types.
|
||||
!!! error TS2430: Type 'Keyed<K, V>' is not assignable to type 'this'.
|
||||
!!! error TS2430: 'Keyed<K, V>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Keyed<K, V>'.
|
||||
!!! error TS2430: 'this' could be instantiated with an arbitrary type which could be unrelated to 'Keyed<K, V>'.
|
||||
toJS(): Object;
|
||||
toJSON(): { [key: string]: V };
|
||||
toSeq(): Seq.Keyed<K, V>;
|
||||
@@ -402,7 +402,7 @@ tests/cases/compiler/immutable.ts(391,22): error TS2430: Interface 'Set<T>' inco
|
||||
!!! error TS2430: Interface 'Indexed<T>' incorrectly extends interface 'Collection<number, T>'.
|
||||
!!! error TS2430: The types returned by 'toSeq()' are incompatible between these types.
|
||||
!!! error TS2430: Type 'Indexed<T>' is not assignable to type 'this'.
|
||||
!!! error TS2430: 'Indexed<T>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Indexed<T>'.
|
||||
!!! error TS2430: 'this' could be instantiated with an arbitrary type which could be unrelated to 'Indexed<T>'.
|
||||
toJS(): Array<any>;
|
||||
toJSON(): Array<T>;
|
||||
// Reading values
|
||||
@@ -439,7 +439,7 @@ tests/cases/compiler/immutable.ts(391,22): error TS2430: Interface 'Set<T>' inco
|
||||
!!! error TS2430: Interface 'Set<T>' incorrectly extends interface 'Collection<never, T>'.
|
||||
!!! error TS2430: The types returned by 'toSeq()' are incompatible between these types.
|
||||
!!! error TS2430: Type 'Set<T>' is not assignable to type 'this'.
|
||||
!!! error TS2430: 'Set<T>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Set<T>'.
|
||||
!!! error TS2430: 'this' could be instantiated with an arbitrary type which could be unrelated to 'Set<T>'.
|
||||
toJS(): Array<any>;
|
||||
toJSON(): Array<T>;
|
||||
toSeq(): Seq.Set<T>;
|
||||
|
||||
@@ -14,9 +14,9 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(30,9): error TS23
|
||||
Type 'string | undefined' is not assignable to type 'string'.
|
||||
Type 'undefined' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2322: Type 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>' is not assignable to type 'T'.
|
||||
'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes1.ts(104,5): error TS2322: Type 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>' is not assignable to type 'T'.
|
||||
'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes1.ts(106,5): error TS2322: Type 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>' is not assignable to type 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>'.
|
||||
Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes1.ts(108,5): error TS2322: Type 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>' is not assignable to type 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>'.
|
||||
@@ -40,12 +40,13 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(137,10): error TS
|
||||
tests/cases/conformance/types/conditional/conditionalTypes1.ts(159,5): error TS2322: Type 'ZeroOf<T>' is not assignable to type 'T'.
|
||||
'ZeroOf<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'.
|
||||
Type '0' is not assignable to type 'T'.
|
||||
'0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
Type '"" | 0' is not assignable to type 'T'.
|
||||
'"" | 0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
Type '""' is not assignable to type 'T'.
|
||||
'""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '0 | (T extends string ? "" : false)'.
|
||||
Type '0' is not assignable to type 'T'.
|
||||
'0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
Type '"" | 0' is not assignable to type 'T'.
|
||||
'"" | 0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
Type '""' is not assignable to type 'T'.
|
||||
'""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes1.ts(160,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf<T>'.
|
||||
Type 'string | number' is not assignable to type 'ZeroOf<T>'.
|
||||
Type 'string' is not assignable to type 'ZeroOf<T>'.
|
||||
@@ -181,11 +182,11 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
|
||||
x = y; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>'.
|
||||
x = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>'.
|
||||
y = x;
|
||||
y = z; // Error
|
||||
~
|
||||
@@ -275,12 +276,13 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
|
||||
!!! error TS2322: Type 'ZeroOf<T>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'ZeroOf<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
!!! error TS2322: Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'.
|
||||
!!! error TS2322: Type '0' is not assignable to type 'T'.
|
||||
!!! error TS2322: '0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
!!! error TS2322: Type '"" | 0' is not assignable to type 'T'.
|
||||
!!! error TS2322: '"" | 0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
!!! error TS2322: Type '""' is not assignable to type 'T'.
|
||||
!!! error TS2322: '""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to '0 | (T extends string ? "" : false)'.
|
||||
!!! error TS2322: Type '0' is not assignable to type 'T'.
|
||||
!!! error TS2322: '0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
!!! error TS2322: Type '"" | 0' is not assignable to type 'T'.
|
||||
!!! error TS2322: '"" | 0' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
!!! error TS2322: Type '""' is not assignable to type 'T'.
|
||||
!!! error TS2322: '""' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'string | number'.
|
||||
y = x; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'ZeroOf<T>'.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/types/conditional/conditionalTypes2.ts(15,5): error TS2322: Type 'Covariant<A>' is not assignable to type 'Covariant<B>'.
|
||||
Type 'A' is not assignable to type 'B'.
|
||||
'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint '{}'.
|
||||
'B' could be instantiated with an arbitrary type which could be unrelated to 'A'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes2.ts(19,5): error TS2322: Type 'Contravariant<B>' is not assignable to type 'Contravariant<A>'.
|
||||
Type 'A' is not assignable to type 'B'.
|
||||
'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint '{}'.
|
||||
'B' could be instantiated with an arbitrary type which could be unrelated to 'A'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes2.ts(24,5): error TS2322: Type 'Invariant<B>' is not assignable to type 'Invariant<A>'.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'B extends string ? keyof B : B' is not assignable to type 'A extends string ? keyof A : A'.
|
||||
@@ -21,7 +21,7 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(25,5): error TS23
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'A extends string ? keyof A : A' is not assignable to type 'B extends string ? keyof B : B'.
|
||||
Type 'A' is not assignable to type 'B'.
|
||||
'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint '{}'.
|
||||
'B' could be instantiated with an arbitrary type which could be unrelated to 'A'.
|
||||
tests/cases/conformance/types/conditional/conditionalTypes2.ts(73,12): error TS2345: Argument of type 'Extract<Extract<T, Foo>, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
|
||||
Property 'bat' is missing in type 'Bar & Foo' but required in type '{ foo: string; bat: string; }'.
|
||||
Type 'Extract<T, Bar>' is not assignable to type '{ foo: string; bat: string; }'.
|
||||
@@ -52,7 +52,7 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
|
||||
~
|
||||
!!! error TS2322: Type 'Covariant<A>' is not assignable to type 'Covariant<B>'.
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
!!! error TS2322: 'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'B' could be instantiated with an arbitrary type which could be unrelated to 'A'.
|
||||
}
|
||||
|
||||
function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
|
||||
@@ -60,7 +60,7 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
|
||||
~
|
||||
!!! error TS2322: Type 'Contravariant<B>' is not assignable to type 'Contravariant<A>'.
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
!!! error TS2322: 'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'B' could be instantiated with an arbitrary type which could be unrelated to 'A'.
|
||||
b = a;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
|
||||
!!! error TS2322: Types of property 'foo' are incompatible.
|
||||
!!! error TS2322: Type 'A extends string ? keyof A : A' is not assignable to type 'B extends string ? keyof B : B'.
|
||||
!!! error TS2322: Type 'A' is not assignable to type 'B'.
|
||||
!!! error TS2322: 'A' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'B' could be instantiated with an arbitrary type which could be unrelated to 'A'.
|
||||
}
|
||||
|
||||
// Extract<T, Function> is a T that is known to be a Function
|
||||
|
||||
@@ -4,7 +4,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(67,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a2(...)' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts (2 errors) ====
|
||||
@@ -83,7 +83,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
// N's
|
||||
a2: new <T>(x: T) => string; // error because base returns non-void;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'number' is not assignable to type 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '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'.
|
||||
@@ -30,7 +30,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
The types returned by 'new a2(...)' are incompatible between these types.
|
||||
Type 'string[]' is not assignable to type 'T[]'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(95,19): error TS2430: Interface 'I7' incorrectly extends interface 'C'.
|
||||
The types returned by 'new a2(...)' are incompatible between these types.
|
||||
Type 'T[]' is not assignable to type 'string[]'.
|
||||
@@ -85,7 +85,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! 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 'number' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: The types returned by 'new a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'string[]' is not assignable to type 'T[]'.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
a2: new <T>(x: T) => string[]; // error
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -3,32 +3,32 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
Type 'new (x: T) => T[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(28,11): error TS2430: Interface 'I2<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type 'new (x: T) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(32,11): error TS2430: Interface 'I3<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => void'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(36,11): error TS2430: Interface 'I4<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type 'new <U>(x: T, y: U) => string' is not assignable to type 'new <T, U>(x: T, y: U) => string'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(40,11): error TS2430: Interface 'I5<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type 'new <U>(x: (arg: T) => U) => T' is not assignable to type 'new <T, U>(x: (arg: T) => U) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(44,11): error TS2430: Interface 'I7<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a11' are incompatible.
|
||||
Type 'new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base' is not assignable to type 'new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base'.
|
||||
@@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(48,11): error TS2430: Interface 'I9<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a16' are incompatible.
|
||||
Type 'new (x: { a: T; b: T; }) => T[]' is not assignable to type 'new <T extends Base>(x: { a: T; b: T; }) => T[]'.
|
||||
@@ -44,9 +44,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts (7 errors) ====
|
||||
@@ -80,7 +80,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Type 'new (x: T) => T[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: new (x: T) => T[];
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Type 'new (x: T) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: new (x: T) => string[];
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => void'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Type 'new <U>(x: T, y: U) => string' is not assignable to type 'new <T, U>(x: T, y: U) => string'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: new <U>(x: T, y: U) => string;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Types of parameters 'arg' and 'arg' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: new <U>(x: (arg: T) => U) => T;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: Types of property 'foo' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc
|
||||
!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
a16: new (x: { a: T; b: T }) => T[];
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type '1' is not assignable to type 'string'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2322: Type 'Date' is not assignable to type 'T'.
|
||||
'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
|
||||
|
||||
@@ -22,10 +22,10 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
constructor(x: T = 1, public y: U = x) { // error
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2322: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
var z = x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' is not assignable to type 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts (4 errors) ====
|
||||
@@ -40,7 +40,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl
|
||||
!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
!!! related TS6500 tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts:24:5: The expected type comes from property 'x' which is declared here on type 'F<T>'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '<T>(x: T) => T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'.
|
||||
'E' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'E'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'.
|
||||
'E' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'E'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'E'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(51,13): error TS2322: Type 'E' is not assignable to type 'A'.
|
||||
'E' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype of constraint 'Number'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B'.
|
||||
@@ -105,14 +106,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
|
||||
x = e;
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'E' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'E'.
|
||||
y = e;
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'E' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'E'.
|
||||
z = e;
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'E'.
|
||||
var a: A = e;
|
||||
~
|
||||
!!! error TS2322: Type 'E' is not assignable to type 'A'.
|
||||
|
||||
+4
@@ -1,5 +1,7 @@
|
||||
tests/cases/compiler/errorElaborationDivesIntoApparentlyPresentPropsOnly.ts(2,5): error TS2322: Type '{ a: string; b: number; c: number; }' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '{ a: string; b: number; c: number; }'.
|
||||
tests/cases/compiler/errorElaborationDivesIntoApparentlyPresentPropsOnly.ts(6,5): error TS2322: Type '{ a: number; }' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '{ a: number; }'.
|
||||
tests/cases/compiler/errorElaborationDivesIntoApparentlyPresentPropsOnly.ts(10,5): error TS2322: Type '{ a: string; }' is not assignable to type 'T'.
|
||||
'{ a: string; }' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{ a: string; }'.
|
||||
|
||||
@@ -9,12 +11,14 @@ tests/cases/compiler/errorElaborationDivesIntoApparentlyPresentPropsOnly.ts(10,5
|
||||
x = { a: "abc", b: 20, c: 30 };
|
||||
~
|
||||
!!! error TS2322: Type '{ a: string; b: number; c: number; }' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to '{ a: string; b: number; c: number; }'.
|
||||
}
|
||||
|
||||
function bar<T extends { a: string }>(x: T) {
|
||||
x = { a: 20 };
|
||||
~
|
||||
!!! error TS2322: Type '{ a: number; }' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to '{ a: number; }'.
|
||||
}
|
||||
|
||||
function baz<T extends { a: string }>(x: T) {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
tests/cases/compiler/errorMessagesIntersectionTypes03.ts(17,5): error TS2322: Type 'A & B' is not assignable to type 'T'.
|
||||
'A & B' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'A & B'.
|
||||
tests/cases/compiler/errorMessagesIntersectionTypes03.ts(18,5): error TS2322: Type 'A & B' is not assignable to type 'U'.
|
||||
'A & B' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'A'.
|
||||
tests/cases/compiler/errorMessagesIntersectionTypes03.ts(19,5): error TS2322: Type 'A & B' is not assignable to type 'V'.
|
||||
'A & B' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint 'A'.
|
||||
tests/cases/compiler/errorMessagesIntersectionTypes03.ts(22,5): error TS2322: Type 'T & B' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T & B'.
|
||||
tests/cases/compiler/errorMessagesIntersectionTypes03.ts(23,5): error TS2322: Type 'T & B' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'T & B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/errorMessagesIntersectionTypes03.ts (5 errors) ====
|
||||
@@ -28,7 +30,7 @@ tests/cases/compiler/errorMessagesIntersectionTypes03.ts(23,5): error TS2322: Ty
|
||||
t = a_and_b;
|
||||
~
|
||||
!!! error TS2322: Type 'A & B' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'A & B' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'A & B'.
|
||||
u = a_and_b;
|
||||
~
|
||||
!!! error TS2322: Type 'A & B' is not assignable to type 'U'.
|
||||
@@ -42,7 +44,9 @@ tests/cases/compiler/errorMessagesIntersectionTypes03.ts(23,5): error TS2322: Ty
|
||||
u = t_and_b;
|
||||
~
|
||||
!!! error TS2322: Type 'T & B' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T & B'.
|
||||
v = t_and_b;
|
||||
~
|
||||
!!! error TS2322: Type 'T & B' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'T & B'.
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(9,1): error TS2322: Type '<S>() => S[]' is not assignable to type '<T>(x: T) => T'.
|
||||
Type 'unknown[]' is not assignable to type 'T'.
|
||||
'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown[]'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts (1 errors) ====
|
||||
@@ -16,7 +16,7 @@ tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(9,1): error TS2322:
|
||||
~
|
||||
!!! error TS2322: Type '<S>() => S[]' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'unknown[]' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown[]'.
|
||||
var s = f("str").toUpperCase();
|
||||
|
||||
console.log(s);
|
||||
|
||||
@@ -3,15 +3,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,23): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
Types of parameters 'x' and 'a' are incompatible.
|
||||
Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,23): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
Types of parameters 'x' and 'a' are incompatible.
|
||||
Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,24): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
Types of parameters 'x' and 'a' are incompatible.
|
||||
Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,23): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
|
||||
Type 'string' is not assignable to type '1'.
|
||||
|
||||
@@ -54,7 +54,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
|
||||
!!! error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
!!! error TS2345: Types of parameters 'x' and 'a' are incompatible.
|
||||
!!! error TS2345: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r10 = foo2(1, (x) => ''); // string
|
||||
|
||||
var r11 = foo3(1, (x: T) => '', ''); // error
|
||||
@@ -62,13 +62,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
|
||||
!!! error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
!!! error TS2345: Types of parameters 'x' and 'a' are incompatible.
|
||||
!!! error TS2345: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r11b = foo3(1, (x: T) => '', 1); // error
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
!!! error TS2345: Types of parameters 'x' and 'a' are incompatible.
|
||||
!!! error TS2345: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r12 = foo3(1, function (a) { return '' }, 1); // error
|
||||
~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
|
||||
|
||||
@@ -4,16 +4,20 @@ 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'.
|
||||
'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
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 'Date' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(37,43): error TS2322: 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'.
|
||||
'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
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 'Date' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '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'.
|
||||
|
||||
@@ -44,6 +48,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
|
||||
var r10 = r7(1); // error
|
||||
~
|
||||
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
}
|
||||
|
||||
function foo2<T extends Date>(a: (x: T) => T, b: (x: T) => T) {
|
||||
@@ -57,6 +62,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
|
||||
!!! 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 'Date' is not assignable to type 'T'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date
|
||||
}
|
||||
|
||||
@@ -91,6 +97,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
|
||||
var r10 = r7(1);
|
||||
~
|
||||
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
}
|
||||
|
||||
function foo2<T extends Date, U extends Date>(a: (x: T) => T, b: (x: U) => U) {
|
||||
@@ -104,6 +111,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen
|
||||
!!! 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 'Date' is not assignable to type 'T'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
var r7b = foo2((a) => a, (b) => b);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(19,17): error TS2345: Argument of type 'C' is not assignable to parameter of type 'D'.
|
||||
Property 'y' is missing in type 'C' but required in type 'D'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(30,24): error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'.
|
||||
'C' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts (2 errors) ====
|
||||
@@ -41,7 +41,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj
|
||||
var r5 = foo<T, U>(c, d); // error
|
||||
~
|
||||
!!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: 'C' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'C'.
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(19,23): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'.
|
||||
Type 'void' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(22,24): error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'.
|
||||
'C' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'C'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts (3 errors) ====
|
||||
@@ -38,6 +38,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj
|
||||
var r5 = foo<T, U>(c, d); // error
|
||||
~
|
||||
!!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: 'C' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'C'.
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Number'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'T' is not assignable to type 'V'.
|
||||
'T' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (3 errors) ====
|
||||
@@ -20,12 +20,12 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericC
|
||||
function foo4<T, U extends T>(x: T, y: U = x) { } // error
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
function foo5<T, U extends T>(x: U, y: T = x) { } // ok
|
||||
function foo6<T, U extends T, V extends U>(x: T, y: U, z: V = y) { } // error
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
function foo7<T, U extends T, V extends U>(x: V, y: U = x) { } // should be ok
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,16): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,16): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,17): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,17): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(12,17): error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(13,17): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17): error TS2558: Expected 0 type arguments, but got 1.
|
||||
|
||||
@@ -18,7 +18,7 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17
|
||||
var r2 = f(1);
|
||||
~
|
||||
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r3 = f<any>(null);
|
||||
~~~
|
||||
!!! error TS2558: Expected 0 type arguments, but got 1.
|
||||
@@ -36,7 +36,7 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,17
|
||||
var r12 = f(y);
|
||||
~
|
||||
!!! error TS2345: Argument of type 'U' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
var r22 = f<number>(y);
|
||||
~~~~~~
|
||||
!!! error TS2558: Expected 0 type arguments, but got 1.
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,29): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
Types of parameters 'x' and 'a' are incompatible.
|
||||
Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,30): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
Types of parameters 'x' and 'a' are incompatible.
|
||||
Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,31): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
Types of parameters 'x' and 'a' are incompatible.
|
||||
Type '1' is not assignable to type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,30): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
|
||||
Type 'string' is not assignable to type '1'.
|
||||
|
||||
@@ -76,7 +76,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu
|
||||
!!! error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
!!! error TS2345: Types of parameters 'x' and 'a' are incompatible.
|
||||
!!! error TS2345: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r10 = c.foo2(1, (x) => ''); // string
|
||||
|
||||
var r11 = c3.foo3(1, (x: T) => '', ''); // error
|
||||
@@ -84,13 +84,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu
|
||||
!!! error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
!!! error TS2345: Types of parameters 'x' and 'a' are incompatible.
|
||||
!!! error TS2345: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r11b = c3.foo3(1, (x: T) => '', 1); // error
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'.
|
||||
!!! error TS2345: Types of parameters 'x' and 'a' are incompatible.
|
||||
!!! error TS2345: Type '1' is not assignable to type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r12 = c3.foo3(1, function (a) { return '' }, 1); // error
|
||||
~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
|
||||
|
||||
@@ -3,7 +3,7 @@ tests/cases/compiler/genericDefaultsErrors.ts(4,59): error TS2344: Type 'T' does
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(5,44): error TS2344: Type 'T' does not satisfy the constraint 'number'.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(6,39): error TS2344: Type 'number' does not satisfy the constraint 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(10,5): error TS2558: Expected 2-3 type arguments, but got 1.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(13,5): error TS2558: Expected 2-3 type arguments, but got 4.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(17,13): error TS2345: Argument of type '"a"' is not assignable to parameter of type 'number'.
|
||||
@@ -17,7 +17,7 @@ tests/cases/compiler/genericDefaultsErrors.ts(27,52): error TS2344: Type 'T' doe
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(28,37): error TS2344: Type 'T' does not satisfy the constraint 'number'.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(29,32): error TS2344: Type 'number' does not satisfy the constraint 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(32,15): error TS2707: Generic type 'i09<T, U, V>' requires between 2 and 3 type arguments.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(33,15): error TS2707: Generic type 'i09<T, U, V>' requires between 2 and 3 type arguments.
|
||||
tests/cases/compiler/genericDefaultsErrors.ts(36,15): error TS2707: Generic type 'i09<T, U, V>' requires between 2 and 3 type arguments.
|
||||
@@ -42,7 +42,7 @@ tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2716: Type paramet
|
||||
declare function f06<T, U extends T = number>(): void; // error
|
||||
~~~~~~
|
||||
!!! error TS2344: Type 'number' does not satisfy the constraint 'T'.
|
||||
!!! error TS2344: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2344: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
|
||||
declare function f11<T, U, V = number>(): void;
|
||||
f11(); // ok
|
||||
@@ -91,7 +91,7 @@ tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2716: Type paramet
|
||||
interface i08<T, U extends T = number> { } // error
|
||||
~~~~~~
|
||||
!!! error TS2344: Type 'number' does not satisfy the constraint 'T'.
|
||||
!!! error TS2344: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2344: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
|
||||
interface i09<T, U, V = number> { }
|
||||
type i09t00 = i09; // error
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(6,1): error TS2322: Type '<S>() => S[]' is not assignable to type '<T>(x: T) => T'.
|
||||
Type 'unknown[]' is not assignable to type 'T'.
|
||||
'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown[]'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts (1 errors) ====
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(6,1): err
|
||||
~
|
||||
!!! error TS2322: Type '<S>() => S[]' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2322: Type 'unknown[]' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown[]'.
|
||||
|
||||
var s = f("str").toUpperCase();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/genericImplements.ts(9,5): error TS2416: Property 'f' in type 'X' is not assignable to the same property in base type 'I'.
|
||||
Type '<T extends B>() => T' is not assignable to type '<T extends A>() => T'.
|
||||
Type 'B' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/genericImplements.ts (1 errors) ====
|
||||
@@ -17,6 +18,7 @@ tests/cases/compiler/genericImplements.ts(9,5): error TS2416: Property 'f' in ty
|
||||
!!! error TS2416: Property 'f' in type 'X' is not assignable to the same property in base type 'I'.
|
||||
!!! error TS2416: Type '<T extends B>() => T' is not assignable to type '<T extends A>() => T'.
|
||||
!!! error TS2416: Type 'B' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'B'.
|
||||
} // { f: () => { b; } }
|
||||
|
||||
// OK
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/genericTypeAssertions6.ts(8,13): error TS2352: Conversion of type 'U' to type 'T' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/genericTypeAssertions6.ts(9,13): error TS2352: Conversion of type 'T' to type 'U' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/genericTypeAssertions6.ts(19,17): error TS2352: Conversion of type 'U' to type 'T' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
|
||||
Type 'Date' is not comparable to type 'T'.
|
||||
@@ -19,11 +19,11 @@ tests/cases/compiler/genericTypeAssertions6.ts(19,17): error TS2352: Conversion
|
||||
x = <T>y;
|
||||
~~~~
|
||||
!!! error TS2352: Conversion of type 'U' to type 'T' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
!!! error TS2352: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2352: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
y = <U>x;
|
||||
~~~~
|
||||
!!! error TS2352: Conversion of type 'T' to type 'U' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
|
||||
!!! error TS2352: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2352: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(5,2): error TS2416
|
||||
Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'.
|
||||
Types of parameters 'a' and 'a' are incompatible.
|
||||
Type '{ a: number; }' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '{ a: 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'.
|
||||
@@ -22,6 +23,7 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322
|
||||
!!! error TS2416: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'.
|
||||
!!! error TS2416: Types of parameters 'a' and 'a' are incompatible.
|
||||
!!! error TS2416: Type '{ a: number; }' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to '{ a: number; }'.
|
||||
}
|
||||
var x = new X<{ a: string }>();
|
||||
var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,41): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expected 0 type arguments, but got 1.
|
||||
|
||||
@@ -14,7 +14,7 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,41): error TS2558: Expe
|
||||
var f = <T>(x: B<T>) => { return x.foo(1); } // error
|
||||
~
|
||||
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var f2 = <T>(x: B<T>) => { return x.foo<T>(1); } // error
|
||||
~
|
||||
!!! error TS2558: Expected 0 type arguments, but got 1.
|
||||
|
||||
@@ -4,7 +4,7 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors
|
||||
tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS2380: 'get' and 'set' accessor must have the same type.
|
||||
tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A<string>' is not assignable to type 'A<T>'.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/getAndSetNotIdenticalType2.ts (5 errors) ====
|
||||
@@ -28,7 +28,7 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A<s
|
||||
~~~~~~~~~
|
||||
!!! error TS2322: Type 'A<string>' is not assignable to type 'A<T>'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(8,5): error TS2416:
|
||||
tests/cases/compiler/implementGenericWithMismatchedTypes.ts(17,5): error TS2416: Property 'foo' in type 'C2<T>' is not assignable to the same property in base type 'IFoo2<T>'.
|
||||
Type '<Tstring>(x: Tstring) => number' is not assignable to type '(x: T) => T'.
|
||||
Type 'number' is not assignable to type 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ====
|
||||
@@ -35,7 +35,7 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(17,5): error TS2416:
|
||||
!!! error TS2416: Property 'foo' in type 'C2<T>' is not assignable to the same property in base type 'IFoo2<T>'.
|
||||
!!! error TS2416: Type '<Tstring>(x: Tstring) => number' is not assignable to type '(x: T) => T'.
|
||||
!!! error TS2416: Type 'number' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): error TS2719: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts (1 errors) ====
|
||||
@@ -11,7 +11,7 @@ tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): erro
|
||||
this.x = a;
|
||||
~~~~~~
|
||||
!!! error TS2719: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2719: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2719: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/indexSignatureAndMappedType.ts(6,5): error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, T>'.
|
||||
tests/cases/compiler/indexSignatureAndMappedType.ts(15,5): error TS2322: Type 'Record<K, U>' is not assignable to type '{ [key: string]: T; }'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/indexSignatureAndMappedType.ts(16,5): error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, U>'.
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ tests/cases/compiler/indexSignatureAndMappedType.ts(16,5): error TS2322: Type '{
|
||||
~
|
||||
!!! error TS2322: Type 'Record<K, U>' is not assignable to type '{ [key: string]: T; }'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
y = x; // Error
|
||||
~
|
||||
!!! error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, U>'.
|
||||
|
||||
@@ -4,7 +4,7 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansion
|
||||
tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2322: Type 'OwnerList<T>' is not assignable to type 'List<T>'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type 'List<T>' is not assignable to type 'T'.
|
||||
'List<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'List<T>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts (2 errors) ====
|
||||
@@ -37,7 +37,7 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansion
|
||||
!!! error TS2322: Type 'OwnerList<T>' is not assignable to type 'List<T>'.
|
||||
!!! error TS2322: Types of property 'data' are incompatible.
|
||||
!!! error TS2322: Type 'List<T>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'List<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'List<T>'.
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/types/intersection/intersectionTypeInference.ts(5,5): error TS2322: Type 'T' is not assignable to type 'T & U'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/intersection/intersectionTypeInference.ts(6,5): error TS2322: Type 'U' is not assignable to type 'T & U'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/intersection/intersectionTypeInference.ts (2 errors) ====
|
||||
@@ -15,12 +15,12 @@ tests/cases/conformance/types/intersection/intersectionTypeInference.ts(6,5): er
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'T & U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
result = obj2; // Error
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T & U'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15
|
||||
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'true' is not assignable to type '() => string'.
|
||||
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2539: Cannot assign to 'M' because it is not a variable.
|
||||
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'.
|
||||
'boolean' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'.
|
||||
tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2539: Cannot assign to 'i' because it is not a variable.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26
|
||||
a = x;
|
||||
~
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'boolean' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'.
|
||||
}
|
||||
i = x;
|
||||
~
|
||||
|
||||
@@ -7,7 +7,7 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5
|
||||
tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'.
|
||||
tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2539: Cannot assign to 'M' because it is not a variable.
|
||||
tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2539: Cannot assign to 'i' because it is not a variable.
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1
|
||||
a = x;
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
}
|
||||
i = x;
|
||||
~
|
||||
|
||||
@@ -7,7 +7,7 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5
|
||||
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'.
|
||||
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2539: Cannot assign to 'M' because it is not a variable.
|
||||
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2539: Cannot assign to 'i' because it is not a variable.
|
||||
tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable to type 'E'.
|
||||
|
||||
@@ -52,7 +52,7 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5
|
||||
a = x;
|
||||
~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
}
|
||||
i = x;
|
||||
~
|
||||
|
||||
@@ -7,6 +7,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): e
|
||||
tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'.
|
||||
tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2539: Cannot assign to 'M' because it is not a variable.
|
||||
tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2539: Cannot assign to 'i' because it is not a variable.
|
||||
tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2322: Type 'typeof E' is not assignable to type 'void'.
|
||||
tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2322: Type 'E' is not assignable to type 'void'.
|
||||
@@ -53,6 +54,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e
|
||||
a = x;
|
||||
~
|
||||
!!! error TS2322: Type 'void' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'.
|
||||
}
|
||||
i = x;
|
||||
~
|
||||
|
||||
@@ -53,10 +53,10 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(105,9): error
|
||||
'Extract<keyof T, string>' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'string'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(108,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(111,5): error TS2322: Type 'T[J]' is not assignable to type 'U[J]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(114,5): error TS2322: Type 'T[K]' is not assignable to type 'T[J]'.
|
||||
Type 'K' is not assignable to type 'J'.
|
||||
'K' is assignable to the constraint of type 'J', but 'J' could be instantiated with a different subtype of constraint 'string'.
|
||||
@@ -68,7 +68,7 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(114,5): error
|
||||
'string' is assignable to the constraint of type 'J', but 'J' could be instantiated with a different subtype of constraint 'string'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(117,5): error TS2322: Type 'T[K]' is not assignable to type 'U[J]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(122,5): error TS2322: Type '42' is not assignable to type 'keyof T'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(123,5): error TS2322: Type '"hello"' is not assignable to type 'keyof T'.
|
||||
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(140,5): error TS2322: Type '42' is not assignable to type 'T[K]'.
|
||||
@@ -272,14 +272,14 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error
|
||||
~~
|
||||
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
tj = uj;
|
||||
uj = tj; // error
|
||||
~~
|
||||
!!! error TS2322: Type 'T[J]' is not assignable to type 'U[J]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
tk = tj;
|
||||
tj = tk; // error
|
||||
@@ -299,7 +299,7 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error
|
||||
~~
|
||||
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[J]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
// The constraint of 'keyof T' is 'keyof T'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(11,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(16,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(20,5): error TS2536: Type 'keyof U' cannot be used to index type 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(21,12): error TS2536: Type 'keyof U' cannot be used to index type 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(25,5): error TS2536: Type 'K' cannot be used to index type 'T'.
|
||||
@@ -19,10 +19,10 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(41,5): error TS2
|
||||
Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
||||
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(45,5): error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
|
||||
Type 'undefined' is not assignable to type 'T[K]'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'.
|
||||
@@ -31,32 +31,32 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2
|
||||
Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
||||
Type 'T[string]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'T[keyof T]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(72,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
||||
'Partial<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Partial<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(78,5): error TS2322: Type 'Partial<Thing>' is not assignable to type 'Partial<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(88,5): error TS2322: Type 'Readonly<Thing>' is not assignable to type 'Readonly<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(127,5): error TS2322: Type 'Partial<U>' is not assignable to type 'Identity<U>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(143,5): error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof T]: U[P]; }'.
|
||||
Type 'T[P]' is not assignable to type 'U[P]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(148,5): error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof U]: U[P]; }'.
|
||||
Type 'keyof U' is not assignable to type 'keyof T'.
|
||||
Type 'string | number | symbol' is not assignable to type 'keyof T'.
|
||||
@@ -85,7 +85,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(163,5): error TS
|
||||
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in K]: U[P]; }'.
|
||||
Type 'T[P]' is not assignable to type 'U[P]'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (28 errors) ====
|
||||
@@ -103,7 +103,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
~~~~
|
||||
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function f4<T, U extends T, K extends keyof T>(x: T, y: U, k: K) {
|
||||
@@ -112,7 +112,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
~~~~
|
||||
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function f5<T, U extends T>(x: T, y: U, k: keyof U) {
|
||||
@@ -161,10 +161,10 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
||||
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function f13<T, U extends T, K extends keyof T>(x: T, y: Partial<U>, k: K) {
|
||||
@@ -180,13 +180,13 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
||||
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[K]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function f20<T>(x: T, y: Readonly<T>, k: keyof T) {
|
||||
@@ -209,7 +209,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
~~~~
|
||||
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
~~~~
|
||||
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
||||
}
|
||||
@@ -220,7 +220,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
~~~~
|
||||
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
~~~~
|
||||
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
||||
}
|
||||
@@ -231,7 +231,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
x = y; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Partial<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Partial<T>'.
|
||||
y = x;
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
!!! error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof T]: U[P]; }'.
|
||||
!!! error TS2322: Type 'T[P]' is not assignable to type 'U[P]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function f72<T, U extends T>(x: { [P in keyof T]: T[P] }, y: { [P in keyof U]: U[P] }) {
|
||||
@@ -372,7 +372,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
||||
!!! error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in K]: U[P]; }'.
|
||||
!!! error TS2322: Type 'T[P]' is not assignable to type 'U[P]'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function f80<T>(t: T): Partial<T> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(23,5): error TS2322: Type 'T' is not assignable to type 'Required<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(24,5): error TS2322: Type 'Partial<T>' is not assignable to type 'Required<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(27,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
||||
'Partial<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Partial<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(37,5): error TS2322: Type 'Required<T>' is not assignable to type 'Denullified<T>'.
|
||||
Type 'T[P]' is not assignable to type 'NonNullable<T[P]>'.
|
||||
Type 'T[keyof T]' is not assignable to type 'NonNullable<T[P]>'.
|
||||
@@ -12,11 +12,11 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(39,5): error TS2322: Type '
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(42,5): error TS2322: Type 'T' is not assignable to type 'Required<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(43,5): error TS2322: Type 'Partial<T>' is not assignable to type 'Required<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(47,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
||||
'Partial<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Partial<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(56,5): error TS2322: Type '{}' is not assignable to type 'Denullified<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(57,5): error TS2322: Type '{}' is not assignable to type 'Required<T>'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(58,5): error TS2322: Type '{}' is not assignable to type 'T'.
|
||||
'{}' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '{}'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(92,1): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type 'Foo'.
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(104,1): error TS2739: Type '{ a: number; }' is missing the following properties from type 'Required<Foo>': b, c, d
|
||||
tests/cases/conformance/types/mapped/mappedTypes6.ts(105,1): error TS2739: Type '{ a: number; b: number; }' is missing the following properties from type 'Required<Foo>': c, d
|
||||
@@ -60,7 +60,7 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Canno
|
||||
y = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Partial<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Partial<T>'.
|
||||
z = x;
|
||||
z = y;
|
||||
z = z;
|
||||
@@ -97,7 +97,7 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Canno
|
||||
y = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Partial<T>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Partial<T>'.
|
||||
z = w;
|
||||
z = x;
|
||||
z = y;
|
||||
@@ -115,7 +115,7 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Canno
|
||||
y = {}; // Error
|
||||
~
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'T'.
|
||||
!!! error TS2322: '{}' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to '{}'.
|
||||
z = {};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/compiler/test.ts(4,5): error TS2322: Type 'PassportStatic' is not assignable to type 'Passport'.
|
||||
The types returned by 'use()' are incompatible between these types.
|
||||
Type 'PassportStatic' is not assignable to type 'this'.
|
||||
'this' could be instantiated with an arbitrary type which could be unrelated to 'PassportStatic'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/passport.d.ts (0 errors) ====
|
||||
@@ -27,4 +28,5 @@ tests/cases/compiler/test.ts(4,5): error TS2322: Type 'PassportStatic' is not as
|
||||
~
|
||||
!!! error TS2322: Type 'PassportStatic' is not assignable to type 'Passport'.
|
||||
!!! error TS2322: The types returned by 'use()' are incompatible between these types.
|
||||
!!! error TS2322: Type 'PassportStatic' is not assignable to type 'this'.
|
||||
!!! error TS2322: Type 'PassportStatic' is not assignable to type 'this'.
|
||||
!!! error TS2322: 'this' could be instantiated with an arbitrary type which could be unrelated to 'PassportStatic'.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveAndTypeVariables.ts(10,9): error TS2322: Type 'T' is not assignable to type 'object'.
|
||||
tests/cases/conformance/types/nonPrimitive/nonPrimitiveAndTypeVariables.ts(11,9): error TS2322: Type 'T' is not assignable to type 'object | U'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveAndTypeVariables.ts (2 errors) ====
|
||||
@@ -21,6 +21,6 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveAndTypeVariables.ts(11,9)
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'object | U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec
|
||||
tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'MyList<number>'.
|
||||
Type 'MyList<number>' is not assignable to type 'T'.
|
||||
'MyList<number>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'MyList<number>'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'MyList<number>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (5 errors) ====
|
||||
@@ -83,7 +83,7 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'MyList<number>'.
|
||||
!!! error TS2322: Type 'MyList<number>' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'MyList<number>' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'MyList<number>'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'MyList<number>'.
|
||||
u = t; // was error, ok after constraint made illegal, doesn't matter
|
||||
|
||||
var a: List<number>;
|
||||
|
||||
@@ -2,6 +2,7 @@ tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOn
|
||||
tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(25,16): error TS2339: Property 'notHere' does not exist on type 'B'.
|
||||
tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(32,22): error TS2339: Property 'notHere' does not exist on type 'A'.
|
||||
tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(38,9): error TS2322: Type 'string' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(38,22): error TS2339: Property 'notHere' does not exist on type 'U'.
|
||||
|
||||
|
||||
@@ -52,6 +53,7 @@ tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOn
|
||||
return a + x.notHere();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
~~~~~~~
|
||||
!!! error TS2339: Property 'notHere' does not exist on type 'U'.
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(8,5): error TS2416: Property 'foo' in type 'D1<T, U>' is not assignable to the same property in base type 'C3<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts (1 errors) ====
|
||||
@@ -15,7 +15,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D1<T, U>' is not assignable to the same property in base type 'C3<T>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
}
|
||||
|
||||
function f1<T, U>(x: T, y: U) {
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(19,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(19,5): error TS2416: Property 'foo' in type 'D3<T, U>' is not assignable to the same property in base type 'C3<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(50,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(50,5): error TS2416: Property 'foo' in type 'D8<T, U, V>' is not assignable to the same property in base type 'C3<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(67,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(67,5): error TS2416: Property 'foo' in type 'D11<T, U, V>' is not assignable to the same property in base type 'C3<T>'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(72,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(72,5): error TS2416: Property 'foo' in type 'D12<T, U, V>' is not assignable to the same property in base type 'C3<U>'.
|
||||
Type 'V' is not assignable to type 'U'.
|
||||
'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(112,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(112,5): error TS2416: Property 'foo' in type 'D19<T, U, V>' is not assignable to the same property in base type 'C3<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
@@ -75,7 +75,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D3<T, U>' is not assignable to the same property in base type 'C3<T>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
}
|
||||
|
||||
class D4<T extends U, U> extends C3<U> {
|
||||
@@ -112,9 +112,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D8<T, U, V>' is not assignable to the same property in base type 'C3<T>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
}
|
||||
|
||||
class D9<T extends U, U extends V, V> extends C3<U> {
|
||||
@@ -137,7 +137,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D11<T, U, V>' is not assignable to the same property in base type 'C3<T>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
}
|
||||
|
||||
class D12<T extends U, U extends V, V> extends C3<U> {
|
||||
@@ -148,7 +148,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D12<T, U, V>' is not assignable to the same property in base type 'C3<U>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
}
|
||||
|
||||
class D13<T extends U, U extends V, V> extends C3<V> {
|
||||
|
||||
@@ -6,19 +6,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
Type 'Foo' is not assignable to type 'T'.
|
||||
'Foo' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(62,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(62,5): error TS2416: Property 'foo' in type 'D6<T, U, V>' is not assignable to the same property in base type 'B1<T>'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(67,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(67,5): error TS2416: Property 'foo' in type 'D7<T, U, V>' is not assignable to the same property in base type 'B1<U>'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
Type 'Foo' is not assignable to type 'U'.
|
||||
'Foo' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(77,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(77,5): error TS2416: Property 'foo' in type 'D9<T, U, V>' is not assignable to the same property in base type 'B1<U>'.
|
||||
Type 'V' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts (10 errors) ====
|
||||
@@ -91,7 +93,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2416: Type 'Foo' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'Foo' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
}
|
||||
|
||||
class D6<T extends Foo, U extends Foo, V> extends B1<T> {
|
||||
@@ -102,6 +104,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D6<T, U, V>' is not assignable to the same property in base type 'B1<T>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
}
|
||||
|
||||
class D7<T extends Foo, U extends Foo, V> extends B1<U> {
|
||||
@@ -114,7 +117,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2416: Type 'Foo' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'Foo' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
}
|
||||
|
||||
class D8<T extends Foo, U extends Foo, V> extends B1<U> {
|
||||
@@ -130,4 +133,5 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D9<T, U, V>' is not assignable to the same property in base type 'B1<U>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
}
|
||||
+72
-24
@@ -1,63 +1,87 @@
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2416: Property 'foo' in type 'D2<T, U, V>' is not assignable to the same property in base type 'Base<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
Type 'Foo<T>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'Foo<T>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(73,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(73,9): error TS2416: Property 'foo' in type 'D3<T, U, V>' is not assignable to the same property in base type 'Base<T>'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
Type 'Foo<V>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
Type 'Foo<V>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(78,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(78,9): error TS2416: Property 'foo' in type 'D4<T, U, V>' is not assignable to the same property in base type 'Base<U>'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
Type 'Foo<U>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Foo<U>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(88,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(88,9): error TS2416: Property 'foo' in type 'D6<T, U, V>' is not assignable to the same property in base type 'Base<U>'.
|
||||
Type 'V' is not assignable to type 'U'.
|
||||
Type 'Foo<V>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
Type 'Foo<V>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(93,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(93,9): error TS2416: Property 'foo' in type 'D7<T, U, V>' is not assignable to the same property in base type 'Base<V>'.
|
||||
Type 'T' is not assignable to type 'V'.
|
||||
Type 'Foo<U>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Foo<U>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(98,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(98,9): error TS2416: Property 'foo' in type 'D8<T, U, V>' is not assignable to the same property in base type 'Base<V>'.
|
||||
Type 'U' is not assignable to type 'V'.
|
||||
Type 'Foo<T>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'Foo<T>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(115,9): error TS2416: Property 'foo' in type 'D1<T, U, V>' is not assignable to the same property in base type 'Base2<T>'.
|
||||
Type 'T' is not assignable to type 'Foo<T>'.
|
||||
Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
Type 'Foo<T>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'Foo<T>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(120,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(125,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(125,9): error TS2416: Property 'foo' in type 'D3<T, U, V>' is not assignable to the same property in base type 'Base2<T>'.
|
||||
Type 'V' is not assignable to type 'Foo<T>'.
|
||||
Type 'Foo<V>' is not assignable to type 'Foo<T>'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
Type 'Foo<V>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
Type 'Foo<V>' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(130,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(135,9): error TS2416: Property 'foo' in type 'D5<T, U, V>' is not assignable to the same property in base type 'Base2<U>'.
|
||||
Type 'U' is not assignable to type 'Foo<U>'.
|
||||
Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
Type 'Foo<U>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Foo<U>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(140,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(140,9): error TS2416: Property 'foo' in type 'D6<T, U, V>' is not assignable to the same property in base type 'Base2<U>'.
|
||||
Type 'V' is not assignable to type 'Foo<U>'.
|
||||
Type 'Foo<V>' is not assignable to type 'Foo<U>'.
|
||||
Type 'V' is not assignable to type 'U'.
|
||||
Type 'Foo<V>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
Type 'Foo<V>' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(145,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(145,9): error TS2416: Property 'foo' in type 'D7<T, U, V>' is not assignable to the same property in base type 'Base2<V>'.
|
||||
Type 'T' is not assignable to type 'Foo<V>'.
|
||||
Type 'Foo<U>' is not assignable to type 'Foo<V>'.
|
||||
Type 'U' is not assignable to type 'V'.
|
||||
Type 'Foo<T>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'Foo<T>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(150,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(150,9): error TS2416: Property 'foo' in type 'D8<T, U, V>' is not assignable to the same property in base type 'Base2<V>'.
|
||||
Type 'U' is not assignable to type 'Foo<V>'.
|
||||
Type 'Foo<T>' is not assignable to type 'Foo<V>'.
|
||||
Type 'T' is not assignable to type 'V'.
|
||||
Type 'Foo<U>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Foo<U>' is not assignable to type 'V'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts (24 errors) ====
|
||||
@@ -134,7 +158,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D2<T, U, V>' is not assignable to the same property in base type 'Base<T>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
}
|
||||
|
||||
class D3<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> {
|
||||
@@ -145,7 +171,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D3<T, U, V>' is not assignable to the same property in base type 'Base<T>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
}
|
||||
|
||||
class D4<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> {
|
||||
@@ -156,7 +184,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D4<T, U, V>' is not assignable to the same property in base type 'Base<U>'.
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
}
|
||||
|
||||
class D5<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> {
|
||||
@@ -172,7 +202,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D6<T, U, V>' is not assignable to the same property in base type 'Base<U>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
}
|
||||
|
||||
class D7<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> {
|
||||
@@ -183,7 +215,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D7<T, U, V>' is not assignable to the same property in base type 'Base<V>'.
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'V'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
}
|
||||
|
||||
class D8<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> {
|
||||
@@ -194,7 +228,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
~~~
|
||||
!!! error TS2416: Property 'foo' in type 'D8<T, U, V>' is not assignable to the same property in base type 'Base<V>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'V'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
}
|
||||
|
||||
class D9<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> {
|
||||
@@ -217,7 +253,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'Foo<T>'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
}
|
||||
|
||||
class D2<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<T> {
|
||||
@@ -237,7 +275,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'Foo<T>'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'Foo<T>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'T'.
|
||||
!!! error TS2416: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
}
|
||||
|
||||
class D4<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<U> {
|
||||
@@ -255,7 +295,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'Foo<U>'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
}
|
||||
|
||||
class D6<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<U> {
|
||||
@@ -268,7 +310,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'Foo<U>'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'Foo<U>'.
|
||||
!!! error TS2416: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
!!! error TS2416: Type 'Foo<V>' is not assignable to type 'U'.
|
||||
!!! error TS2416: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo<V>'.
|
||||
}
|
||||
|
||||
class D7<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<V> {
|
||||
@@ -281,7 +325,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'Foo<V>'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'Foo<V>'.
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'V'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<T>'.
|
||||
}
|
||||
|
||||
class D8<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<V> {
|
||||
@@ -294,7 +340,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
|
||||
!!! error TS2416: Type 'U' is not assignable to type 'Foo<V>'.
|
||||
!!! error TS2416: Type 'Foo<T>' is not assignable to type 'Foo<V>'.
|
||||
!!! error TS2416: Type 'T' is not assignable to type 'V'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2416: Type 'Foo<U>' is not assignable to type 'V'.
|
||||
!!! error TS2416: 'V' could be instantiated with an arbitrary type which could be unrelated to 'Foo<U>'.
|
||||
}
|
||||
|
||||
class D9<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<V> {
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(76,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts (2 errors) ====
|
||||
@@ -92,7 +92,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
// N's
|
||||
a2: <T>(x: T) => string; // error because base returns non-void;
|
||||
}
|
||||
|
||||
@@ -3,32 +3,32 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
Type 'new (x: T) => T[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(28,11): error TS2430: Interface 'I2<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type 'new (x: T) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(32,11): error TS2430: Interface 'I3<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => void'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(36,11): error TS2430: Interface 'I4<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type 'new <U>(x: T, y: U) => string' is not assignable to type 'new <T, U>(x: T, y: U) => string'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(40,11): error TS2430: Interface 'I5<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type 'new <U>(x: (arg: T) => U) => T' is not assignable to type 'new <T, U>(x: (arg: T) => U) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Types of parameters 'arg' and 'arg' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(44,11): error TS2430: Interface 'I7<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a11' are incompatible.
|
||||
Type 'new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base' is not assignable to type 'new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base'.
|
||||
@@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
Types of property 'foo' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts(48,11): error TS2430: Interface 'I9<T>' incorrectly extends interface 'A'.
|
||||
Types of property 'a16' are incompatible.
|
||||
Type 'new (x: { a: T; b: T; }) => T[]' is not assignable to type 'new <T extends Base>(x: { a: T; b: T; }) => T[]'.
|
||||
@@ -44,9 +44,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts (7 errors) ====
|
||||
@@ -80,7 +80,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => T[]' is not assignable to type 'new <T>(x: T) => T[]'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: new (x: T) => T[];
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => string[]' is not assignable to type 'new <T>(x: T) => string[]'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: new (x: T) => string[];
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => void'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new <U>(x: T, y: U) => string' is not assignable to type 'new <T, U>(x: T, y: U) => string'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: new <U>(x: T, y: U) => string;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Types of parameters 'arg' and 'arg' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: new <U>(x: (arg: T) => U) => T;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '{ foo: T; }' is not assignable to type '{ foo: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: Types of property 'foo' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ a: T; b: T; }'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: Types of property 'a' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
a16: new (x: { a: T; b: T }) => T[];
|
||||
}
|
||||
+2
-2
@@ -4,7 +4,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(76,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a2(...)' are incompatible between these types.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts (2 errors) ====
|
||||
@@ -92,7 +92,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'string' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
// N's
|
||||
a2: new <T>(x: T) => string; // error because base returns non-void;
|
||||
}
|
||||
|
||||
+32
-32
@@ -7,93 +7,93 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a()' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(104,15): error TS2430: Interface 'I2<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a2(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(117,15): error TS2430: Interface 'I5<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type '(x?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(121,15): error TS2430: Interface 'I6<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(126,15): error TS2430: Interface 'I7<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a3(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(130,15): error TS2430: Interface 'I8<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(134,15): error TS2430: Interface 'I9<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type '(x: T, y: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a4(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(147,15): error TS2430: Interface 'I12<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(151,15): error TS2430: Interface 'I13<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(155,15): error TS2430: Interface 'I14<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type '(x: T, y: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(160,15): error TS2430: Interface 'I15<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'a5(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(164,15): error TS2430: Interface 'I16<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(168,15): error TS2430: Interface 'I17<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type '(x: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(172,15): error TS2430: Interface 'I18<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type '(x: T, y: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type '<T>(x: T) => T' is not assignable to type '<T>() => T'.
|
||||
@@ -215,7 +215,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I1<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a()' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: () => T;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I2<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: (x?: T) => T;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I4<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: () => T;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x?: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: (x?: T) => T
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '<T>(x?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I7<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a3(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: () => T;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x?: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: (x?: T) => T;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '<T>(x: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I11<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a4(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: () => T;
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: (x?: T, y?: T) => T;
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: (x: T, y: T) => T;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I15<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'a5(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: () => T;
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: (x?: T, y?: T) => T;
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: (x: T, y: T) => T;
|
||||
}
|
||||
}
|
||||
|
||||
+32
-32
@@ -7,93 +7,93 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a()' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(104,15): error TS2430: Interface 'I2<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>() => T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(113,15): error TS2430: Interface 'I4<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a2(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(117,15): error TS2430: Interface 'I5<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type 'new (x?: T) => T' is not assignable to type 'new <T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(121,15): error TS2430: Interface 'I6<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a2' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>(x?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(126,15): error TS2430: Interface 'I7<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a3(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(130,15): error TS2430: Interface 'I8<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x?: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(134,15): error TS2430: Interface 'I9<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a3' are incompatible.
|
||||
Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(143,15): error TS2430: Interface 'I11<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a4(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(147,15): error TS2430: Interface 'I12<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type 'new (x?: T, y?: T) => T' is not assignable to type 'new <T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(151,15): error TS2430: Interface 'I13<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(155,15): error TS2430: Interface 'I14<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a4' are incompatible.
|
||||
Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(160,15): error TS2430: Interface 'I15<T>' incorrectly extends interface 'Base2'.
|
||||
The types returned by 'new a5(...)' are incompatible between these types.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(164,15): error TS2430: Interface 'I16<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type 'new (x?: T, y?: T) => T' is not assignable to type 'new <T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(168,15): error TS2430: Interface 'I17<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type 'new (x: T) => T' is not assignable to type 'new <T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(172,15): error TS2430: Interface 'I18<T>' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a5' are incompatible.
|
||||
Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x?: T, y?: T) => T'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'.
|
||||
Types of property 'a' are incompatible.
|
||||
Type 'new <T>(x: T) => T' is not assignable to type 'new <T>() => T'.
|
||||
@@ -215,7 +215,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I1<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a()' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: new () => T;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I2<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a: new (x?: T) => T;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I4<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a2(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: new () => T;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x?: T) => T' is not assignable to type 'new <T>(x?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: new (x?: T) => T
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>(x?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a2: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I7<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a3(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: new () => T;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x?: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: new (x?: T) => T;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a3: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I11<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a4(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: new () => T;
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x?: T, y?: T) => T' is not assignable to type 'new <T>(x: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: new (x?: T, y?: T) => T;
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>(x: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a4: new (x: T, y: T) => T;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'I15<T>' incorrectly extends interface 'Base2'.
|
||||
!!! error TS2430: The types returned by 'new a5(...)' are incompatible between these types.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: new () => T;
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x?: T, y?: T) => T' is not assignable to type 'new <T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: new (x?: T, y?: T) => T;
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new <T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: new (x: T) => T;
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new <T>(x?: T, y?: T) => T'.
|
||||
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2430: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2430: 'T' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
a5: new (x: T, y: T) => T;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(32,15): error TS2430: Interface 'B3<T>' incorrectly extends interface 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(36,15): error TS2430: Interface 'B4<T>' incorrectly extends interface 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived' is not assignable to type 'T'.
|
||||
@@ -59,6 +60,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'B3<T>' incorrectly extends interface 'A<T>'.
|
||||
!!! error TS2430: Index signatures are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
[x: number]: Base; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(32,11): error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(36,11): error TS2415: Class 'B4<T>' incorrectly extends base class 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived' is not assignable to type 'T'.
|
||||
@@ -59,6 +60,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
!!! error TS2415: Index signatures are incompatible.
|
||||
!!! error TS2415: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2415: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
[x: number]: Base; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts (4 errors) ====
|
||||
@@ -52,6 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
!!! error TS2415: Index signatures are incompatible.
|
||||
!!! error TS2415: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2415: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
[x: number]: string; // error
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(32,11): error TS2420: Class 'B3<T>' incorrectly implements interface 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(36,11): error TS2420: Class 'B4<T>' incorrectly implements interface 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived' is not assignable to type 'T'.
|
||||
@@ -58,6 +59,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2420: Class 'B3<T>' incorrectly implements interface 'A<T>'.
|
||||
!!! error TS2420: Index signatures are incompatible.
|
||||
!!! error TS2420: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2420: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
[x: string]: Base; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(32,15): error TS2430: Interface 'B3<T>' incorrectly extends interface 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(36,15): error TS2430: Interface 'B4<T>' incorrectly extends interface 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived' is not assignable to type 'T'.
|
||||
@@ -59,6 +60,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2430: Interface 'B3<T>' incorrectly extends interface 'A<T>'.
|
||||
!!! error TS2430: Index signatures are incompatible.
|
||||
!!! error TS2430: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2430: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
[x: string]: Base; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(32,11): error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Base' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(36,11): error TS2415: Class 'B4<T>' incorrectly extends base class 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived' is not assignable to type 'T'.
|
||||
@@ -59,6 +60,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
!!! error TS2415: Index signatures are incompatible.
|
||||
!!! error TS2415: Type 'Base' is not assignable to type 'T'.
|
||||
!!! error TS2415: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'.
|
||||
[x: string]: Base; // error
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'string' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts (4 errors) ====
|
||||
@@ -52,6 +53,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW
|
||||
!!! error TS2415: Class 'B3<T>' incorrectly extends base class 'A<T>'.
|
||||
!!! error TS2415: Index signatures are incompatible.
|
||||
!!! error TS2415: Type 'string' is not assignable to type 'T'.
|
||||
!!! error TS2415: 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
|
||||
[x: string]: string; // error
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'.
|
||||
'{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'.
|
||||
'P' could be instantiated with an arbitrary type which could be unrelated to '{}'.
|
||||
tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(props: Readonly<P>): MyComponent', gave the following error.
|
||||
Type '{}' is not assignable to type 'Readonly<P>'.
|
||||
@@ -24,7 +24,7 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2769: No o
|
||||
let x = <MySFC />; // should error
|
||||
~~~~~
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'P'.
|
||||
!!! error TS2322: '{}' is assignable to the constraint of type 'P', but 'P' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'P' could be instantiated with an arbitrary type which could be unrelated to '{}'.
|
||||
let y = <MyComponent />; // should error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,15): error TS2558: Expected 0 type arguments, but got 1.
|
||||
tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
'1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,15): error TS2558: Expected 0 type arguments, but got 1.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,15): erro
|
||||
var r2 = f(1);
|
||||
~
|
||||
!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'.
|
||||
!!! error TS2345: '1' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to '1'.
|
||||
var r3 = f<any>(null);
|
||||
~~~
|
||||
!!! error TS2558: Expected 0 type arguments, but got 1.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'.
|
||||
Types of parameters 'item' and 'item' are incompatible.
|
||||
Type 'number' is not assignable to type 'T'.
|
||||
'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'.
|
||||
Types of parameters 'item' and 'item' are incompatible.
|
||||
Type 'T' is not assignable to type 'number'.
|
||||
@@ -16,7 +16,7 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Typ
|
||||
!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'.
|
||||
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'number' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
|
||||
y = x; // Shound be an error
|
||||
~
|
||||
!!! error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'.
|
||||
Types of parameters 'item' and 'item' are incompatible.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'.
|
||||
Types of parameters 'item' and 'item' are incompatible.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterArgumentEquivalence2.ts (2 errors) ====
|
||||
@@ -17,12 +17,12 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Ty
|
||||
!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'.
|
||||
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
y = x; // Shound be an error
|
||||
~
|
||||
!!! error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'.
|
||||
!!! error TS2322: Types of parameters 'item' and 'item' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'.
|
||||
Type 'boolean' is not assignable to type 'T'.
|
||||
'boolean' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'.
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'.
|
||||
Type 'T' is not assignable to type 'boolean'.
|
||||
|
||||
@@ -13,7 +13,7 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Ty
|
||||
~
|
||||
!!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'.
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'boolean' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'.
|
||||
y = x; // Shound be an error
|
||||
~
|
||||
!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterArgumentEquivalence4.ts (2 errors) ====
|
||||
@@ -14,11 +14,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Ty
|
||||
~
|
||||
!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
y = x; // Shound be an error
|
||||
~
|
||||
!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'.
|
||||
Call signature return types '(item: any) => T' and '(item: any) => U' are incompatible.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'.
|
||||
Call signature return types '(item: any) => U' and '(item: any) => T' are incompatible.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterArgumentEquivalence5.ts (2 errors) ====
|
||||
@@ -17,12 +17,12 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Ty
|
||||
!!! error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'.
|
||||
!!! error TS2322: Call signature return types '(item: any) => T' and '(item: any) => U' are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
y = x; // Shound be an error
|
||||
~
|
||||
!!! error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'.
|
||||
!!! error TS2322: Call signature return types '(item: any) => U' and '(item: any) => T' are incompatible.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts (2 errors) ====
|
||||
@@ -11,9 +11,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
t = u; // error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
u = t; // error
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(17,5): error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(20,5): error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(25,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
|
||||
Type 'V' is not assignable to type 'T'.
|
||||
@@ -47,17 +47,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(55,5): error TS2322: Type 'Date' is not assignable to type 'V'.
|
||||
'Date' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint 'Date'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(64,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(65,5): error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(68,5): error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(70,5): error TS2322: Type 'T' is not assignable to type 'V'.
|
||||
'T' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'U' is not assignable to type 'V'.
|
||||
'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(71,5): error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts (22 errors) ====
|
||||
@@ -68,14 +68,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
u = t; // ok
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
function foo2<T extends U, U>(t: T, u: U) {
|
||||
t = u; // error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
u = t; // ok
|
||||
}
|
||||
|
||||
@@ -83,21 +83,21 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
t = u; // error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
u = t;
|
||||
|
||||
t = v; // error
|
||||
~
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
v = t; // ok
|
||||
|
||||
u = v; // error
|
||||
~
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
v = u; // ok
|
||||
}
|
||||
|
||||
@@ -192,26 +192,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
t = u; // error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
t = v; // error
|
||||
~
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
|
||||
u = t; // ok
|
||||
u = v; // error
|
||||
~
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'V' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
|
||||
v = t; // error
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
v = u; // error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
Type 'Foo' is not assignable to type 'T'.
|
||||
'Foo' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(15,5): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
Type 'Foo' is not assignable to type 'U'.
|
||||
'Foo' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(22,9): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
Type 'Foo' is not assignable to type 'T'.
|
||||
'Foo' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
Type 'Foo' is not assignable to type 'U'.
|
||||
'Foo' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts (4 errors) ====
|
||||
@@ -35,13 +35,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Foo' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
u = t; // error
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'Foo' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
}
|
||||
|
||||
class C<T extends Foo, U extends Foo> {
|
||||
@@ -53,12 +53,12 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Foo' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
this.u = this.t; // error
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: Type 'Foo' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'Foo' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'Foo'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Foo'.
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,5): error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
@@ -18,7 +18,7 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,9): error TS2322: Type
|
||||
~
|
||||
!!! error TS2322: Type 'Foo<U>' is not assignable to type 'Foo<T>'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
return x;
|
||||
~~~~~~~~~
|
||||
!!! error TS2322: Type 'Foo<T>' is not assignable to type 'Foo<U>'.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
tests/cases/compiler/typeParameterDiamond2.ts(8,13): error TS2322: Type 'T | U' is not assignable to type 'Top'.
|
||||
'T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
Type 'U' is not assignable to type 'Top'.
|
||||
'U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/typeParameterDiamond2.ts(10,13): error TS2322: Type 'Bottom' is not assignable to type 'Top'.
|
||||
'Bottom' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
Type 'T | U' is not assignable to type 'Top'.
|
||||
'T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
Type 'U' is not assignable to type 'Top'.
|
||||
'U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterDiamond2.ts (2 errors) ====
|
||||
@@ -21,18 +21,18 @@ tests/cases/compiler/typeParameterDiamond2.ts(10,13): error TS2322: Type 'Bottom
|
||||
top = middle;
|
||||
~~~
|
||||
!!! error TS2322: Type 'T | U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
middle = bottom;
|
||||
top = bottom;
|
||||
~~~
|
||||
!!! error TS2322: Type 'Bottom' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'Bottom' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
!!! error TS2322: Type 'T | U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
tests/cases/compiler/typeParameterDiamond3.ts(8,13): error TS2322: Type 'T | U' is not assignable to type 'Top'.
|
||||
'T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
Type 'T' is not assignable to type 'Top'.
|
||||
'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/typeParameterDiamond3.ts(9,13): error TS2322: Type 'Bottom' is not assignable to type 'T | U'.
|
||||
Type 'Top | T | U' is not assignable to type 'T | U'.
|
||||
Type 'Top' is not assignable to type 'T | U'.
|
||||
Type 'Top' is not assignable to type 'U'.
|
||||
'Top' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Top'.
|
||||
Type 'Bottom' is not assignable to type 'U'.
|
||||
'Bottom' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
Type 'Top | T | U' is not assignable to type 'U'.
|
||||
'Top | T | U' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
Type 'Top' is not assignable to type 'U'.
|
||||
'Top' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'Top'.
|
||||
tests/cases/compiler/typeParameterDiamond3.ts(10,13): error TS2322: Type 'Bottom' is not assignable to type 'Top'.
|
||||
'Bottom' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
Type 'Top | T | U' is not assignable to type 'Top'.
|
||||
'Top | T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
Type 'T' is not assignable to type 'Top'.
|
||||
'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterDiamond3.ts (3 errors) ====
|
||||
@@ -32,30 +32,30 @@ tests/cases/compiler/typeParameterDiamond3.ts(10,13): error TS2322: Type 'Bottom
|
||||
top = middle;
|
||||
~~~
|
||||
!!! error TS2322: Type 'T | U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
middle = bottom;
|
||||
~~~~~~
|
||||
!!! error TS2322: Type 'Bottom' is not assignable to type 'T | U'.
|
||||
!!! error TS2322: Type 'Top | T | U' is not assignable to type 'T | U'.
|
||||
!!! error TS2322: Type 'Top' is not assignable to type 'T | U'.
|
||||
!!! error TS2322: Type 'Top' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'Top' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Top'.
|
||||
!!! error TS2322: Type 'Bottom' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'Bottom' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
!!! error TS2322: Type 'Top | T | U' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'Top | T | U' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
!!! error TS2322: Type 'Top' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'Top' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'Top'.
|
||||
top = bottom;
|
||||
~~~
|
||||
!!! error TS2322: Type 'Bottom' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'Bottom' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
!!! error TS2322: Type 'Top | T | U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'Top | T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
tests/cases/compiler/typeParameterDiamond4.ts(8,13): error TS2322: Type 'Top | T | U' is not assignable to type 'Top'.
|
||||
'Top | T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
Type 'T' is not assignable to type 'Top'.
|
||||
'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/compiler/typeParameterDiamond4.ts(10,13): error TS2322: Type 'Bottom' is not assignable to type 'Top'.
|
||||
'Bottom' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
Type 'Top | T | U' is not assignable to type 'Top'.
|
||||
'Top | T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
Type 'T' is not assignable to type 'Top'.
|
||||
'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParameterDiamond4.ts (2 errors) ====
|
||||
@@ -21,18 +21,18 @@ tests/cases/compiler/typeParameterDiamond4.ts(10,13): error TS2322: Type 'Bottom
|
||||
top = middle;
|
||||
~~~
|
||||
!!! error TS2322: Type 'Top | T | U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'Top | T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
middle = bottom;
|
||||
top = bottom;
|
||||
~~~
|
||||
!!! error TS2322: Type 'Bottom' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'Bottom' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'Bottom'.
|
||||
!!! error TS2322: Type 'Top | T | U' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'Top | T | U' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'Top | T | U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Top'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'Top', but 'Top' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'Top' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
'Object' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Object'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type
|
||||
x = y; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
x = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'Object' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Object'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
z = x; // Ok
|
||||
}
|
||||
|
||||
@@ -3,17 +3,20 @@ tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(4,5): error TS2322: Type
|
||||
Type 'Date' is not assignable to type 'T'.
|
||||
'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(5,5): error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(6,5): error TS2322: Type 'T' is not assignable to type 'V'.
|
||||
'T' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
Type 'Date' is not assignable to type 'V'.
|
||||
'Date' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
Type 'Date' is not assignable to type 'V'.
|
||||
'Date' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
'V' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'Object'.
|
||||
The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
|
||||
|
||||
==== tests/cases/compiler/typeParametersShouldNotBeEqual2.ts (6 errors) ====
|
||||
@@ -29,25 +32,28 @@ tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type
|
||||
x = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
z = x; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
!!! error TS2322: Type 'Date' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'Date' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
y = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'V' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'V'.
|
||||
z = y; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
!!! error TS2322: Type 'Date' is not assignable to type 'V'.
|
||||
!!! error TS2322: 'Date' is assignable to the constraint of type 'V', but 'V' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'V' could be instantiated with an arbitrary type which could be unrelated to 'Date'.
|
||||
x = zz; // Error
|
||||
~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'T'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Object'.
|
||||
!!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
|
||||
zz = x; // Ok
|
||||
}
|
||||
|
||||
@@ -19,17 +19,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTyp
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts(41,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts(43,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts(64,5): error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts(65,5): error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts(70,5): error TS2322: Type 'T | U' is not assignable to type 'T'.
|
||||
'T | U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
Type 'U' is not assignable to type 'T'.
|
||||
'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts(71,5): error TS2322: Type 'T | U' is not assignable to type 'U'.
|
||||
'T | U' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
Type 'T' is not assignable to type 'U'.
|
||||
'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTypesAssignability.ts (19 errors) ====
|
||||
@@ -138,11 +138,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTyp
|
||||
t = u; // error
|
||||
~
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
u = t; // error
|
||||
~
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
var x : T | U;
|
||||
x = t; // ok
|
||||
x = u; // ok
|
||||
@@ -150,14 +150,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/unionTyp
|
||||
t = x; // error U not assignable to T
|
||||
~
|
||||
!!! error TS2322: Type 'T | U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'T | U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
!!! error TS2322: Type 'U' is not assignable to type 'T'.
|
||||
!!! error TS2322: 'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
|
||||
u = x; // error T not assignable to U
|
||||
~
|
||||
!!! error TS2322: Type 'T | U' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T | U' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T | U'.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
||||
!!! error TS2322: 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint '{}'.
|
||||
!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'T'.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user