1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts(24,11): error TS2430: Interface 'I<T>' incorrectly extends interface 'A'.
Types of property 'a' 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.
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.
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.
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.
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.
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'.
Types of parameters 'x' and 'x' are incompatible.
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.
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[]'.
Types of parameters 'x' and 'x' are incompatible.
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.
Type 'Base' is not assignable to type 'T'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts (7 errors) ====
// checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures
// all are errors
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
class OtherDerived extends Base { bing: string; }
interface A { // T
// M's
a: new <T>(x: T) => T[];
a2: new <T>(x: T) => string[];
a3: new <T>(x: T) => void;
a4: new <T, U>(x: T, y: U) => string;
a5: new <T, U>(x: (arg: T) => U) => T;
a6: new <T extends Base>(x: (arg: T) => Derived) => T;
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
a15: new <T>(x: { a: T; b: T }) => T[];
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
}
// S's
interface I<T> extends A {
~
!!! error TS2430: Interface 'I<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a' are incompatible.
!!! 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.
a: new (x: T) => T[];
}
interface I2<T> extends A {
~~
!!! error TS2430: Interface 'I2<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a2' are incompatible.
!!! 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.
a2: new (x: T) => string[];
}
interface I3<T> extends A {
~~
!!! error TS2430: Interface 'I3<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a3' are incompatible.
!!! 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.
a3: new (x: T) => T;
}
interface I4<T> extends A {
~~
!!! error TS2430: Interface 'I4<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a4' are incompatible.
!!! 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.
a4: new <U>(x: T, y: U) => string;
}
interface I5<T> extends A {
~~
!!! error TS2430: Interface 'I5<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a5' are incompatible.
!!! error TS2430: Type 'new <U>(x: (arg: T) => U) => T' is not assignable to type 'new <T, U>(x: (arg: T) => U) => T'.
!!! 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.
a5: new <U>(x: (arg: T) => U) => T;
}
interface I7<T> extends A {
~~
!!! error TS2430: Interface 'I7<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a11' are incompatible.
!!! error TS2430: 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'.
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! 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.
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
}
interface I9<T> extends A {
~~
!!! error TS2430: Interface 'I9<T>' incorrectly extends interface 'A'.
!!! error TS2430: Types of property 'a16' are incompatible.
!!! error TS2430: Type 'new (x: { a: T; b: T; }) => T[]' is not assignable to type 'new <T extends Base>(x: { a: T; b: T; }) => T[]'.
!!! error TS2430: Types of parameters 'x' and 'x' are incompatible.
!!! 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: Type 'Base' is not assignable to type 'T'.
a16: new (x: { a: T; b: T }) => T[];
}
|