|
| 1 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(47,1): error TS2322: Type '(x: number) => number[]' is not assignable to type '<T>(x: T) => T[]'. |
| 2 | + Types of parameters 'x' and 'x' are incompatible. |
| 3 | + Type 'T' is not assignable to type 'number'. |
| 4 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(50,1): error TS2322: Type '(x: number) => string[]' is not assignable to type '<T>(x: T) => string[]'. |
| 5 | + Types of parameters 'x' and 'x' are incompatible. |
| 6 | + Type 'T' is not assignable to type 'number'. |
| 7 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(53,1): error TS2322: Type '(x: number) => void' is not assignable to type '<T>(x: T) => T'. |
| 8 | + Types of parameters 'x' and 'x' are incompatible. |
| 9 | + Type 'T' is not assignable to type 'number'. |
| 10 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(56,1): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '<T, U>(x: T, y: U) => T'. |
| 11 | + Types of parameters 'x' and 'x' are incompatible. |
| 12 | + Type 'T' is not assignable to type 'string'. |
| 13 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(59,1): error TS2322: Type '(x: (arg: string) => number) => string' is not assignable to type '<T, U>(x: (arg: T) => U) => T'. |
| 14 | + Types of parameters 'x' and 'x' are incompatible. |
| 15 | + Types of parameters 'arg' and 'arg' are incompatible. |
| 16 | + Type 'string' is not assignable to type 'T'. |
| 17 | +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'. |
| 18 | + Types of parameters 'x' and 'x' are incompatible. |
| 19 | + Types of parameters 'arg' and 'arg' are incompatible. |
| 20 | + Type 'Base' is not assignable to type 'T'. |
| 21 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(65,1): error TS2322: Type '(x: (arg: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U'. |
| 22 | + Types of parameters 'x' and 'x' are incompatible. |
| 23 | + Types of parameters 'arg' and 'arg' are incompatible. |
| 24 | + Type 'Base' is not assignable to type 'T'. |
| 25 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(68,1): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U'. |
| 26 | + Types of parameters 'x' and 'x' are incompatible. |
| 27 | + Types of parameters 'arg' and 'arg' are incompatible. |
| 28 | + Type 'Base' is not assignable to type 'T'. |
1 | 29 | tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(71,1): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U'.
|
| 30 | + Types of parameters 'x' and 'x' are incompatible. |
| 31 | + Types of parameters 'arg' and 'arg' are incompatible. |
| 32 | + Type 'Base' is not assignable to type 'T'. |
| 33 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(74,1): error TS2322: Type '(...x: Derived[]) => Derived' is not assignable to type '<T extends Derived>(...x: T[]) => T'. |
| 34 | + Type 'Derived' is not assignable to type 'T'. |
| 35 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(77,1): error TS2322: Type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type '<T extends Base>(x: T, y: T) => T'. |
2 | 36 | Types of parameters 'y' and 'y' are incompatible.
|
3 |
| - Types of parameters 'arg2' and 'arg2' are incompatible. |
4 |
| - Type 'Base' is not assignable to type '{ foo: string; bing: number; }'. |
5 |
| - Property 'bing' is missing in type 'Base'. |
| 37 | + Type 'T' is not assignable to type '{ foo: string; bar: string; }'. |
| 38 | + Type 'Base' is not assignable to type '{ foo: string; bar: string; }'. |
| 39 | + Property 'bar' is missing in type 'Base'. |
| 40 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(80,1): error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '<T extends Base[]>(x: Base[], y: T) => Derived[]'. |
| 41 | + Types of parameters 'y' and 'y' are incompatible. |
| 42 | + Type 'T' is not assignable to type 'Derived2[]'. |
| 43 | + Type 'Base[]' is not assignable to type 'Derived2[]'. |
| 44 | + Type 'Base' is not assignable to type 'Derived2'. |
| 45 | + Property 'baz' is missing in type 'Base'. |
| 46 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(83,1): error TS2322: Type '(x: Base[], y: Derived[]) => Derived[]' is not assignable to type '<T extends Derived[]>(x: Base[], y: T) => T'. |
| 47 | + Type 'Derived[]' is not assignable to type 'T'. |
| 48 | +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(86,1): error TS2322: Type '(x: { a: string; b: number; }) => Object' is not assignable to type '<T>(x: { a: T; b: T; }) => T'. |
| 49 | + Types of parameters 'x' and 'x' are incompatible. |
| 50 | + Type '{ a: T; b: T; }' is not assignable to type '{ a: string; b: number; }'. |
| 51 | + Types of property 'a' are incompatible. |
| 52 | + Type 'T' is not assignable to type 'string'. |
6 | 53 |
|
7 | 54 |
|
8 |
| -==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts (1 errors) ==== |
| 55 | +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts (14 errors) ==== |
9 | 56 | // these are all permitted with the current rules, since we do not do contextual signature instantiation
|
10 | 57 |
|
11 | 58 | class Base { foo: string; }
|
@@ -53,51 +100,111 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
53 | 100 | var b: <T>(x: T) => T[];
|
54 | 101 | a = b; // ok
|
55 | 102 | b = a; // ok
|
| 103 | + ~ |
| 104 | +!!! error TS2322: Type '(x: number) => number[]' is not assignable to type '<T>(x: T) => T[]'. |
| 105 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 106 | +!!! error TS2322: Type 'T' is not assignable to type 'number'. |
56 | 107 | var b2: <T>(x: T) => string[];
|
57 | 108 | a2 = b2; // ok
|
58 | 109 | b2 = a2; // ok
|
| 110 | + ~~ |
| 111 | +!!! error TS2322: Type '(x: number) => string[]' is not assignable to type '<T>(x: T) => string[]'. |
| 112 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 113 | +!!! error TS2322: Type 'T' is not assignable to type 'number'. |
59 | 114 | var b3: <T>(x: T) => T;
|
60 | 115 | a3 = b3; // ok
|
61 | 116 | b3 = a3; // ok
|
| 117 | + ~~ |
| 118 | +!!! error TS2322: Type '(x: number) => void' is not assignable to type '<T>(x: T) => T'. |
| 119 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 120 | +!!! error TS2322: Type 'T' is not assignable to type 'number'. |
62 | 121 | var b4: <T, U>(x: T, y: U) => T;
|
63 | 122 | a4 = b4; // ok
|
64 | 123 | b4 = a4; // ok
|
| 124 | + ~~ |
| 125 | +!!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '<T, U>(x: T, y: U) => T'. |
| 126 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 127 | +!!! error TS2322: Type 'T' is not assignable to type 'string'. |
65 | 128 | var b5: <T, U>(x: (arg: T) => U) => T;
|
66 | 129 | a5 = b5; // ok
|
67 | 130 | b5 = a5; // ok
|
| 131 | + ~~ |
| 132 | +!!! error TS2322: Type '(x: (arg: string) => number) => string' is not assignable to type '<T, U>(x: (arg: T) => U) => T'. |
| 133 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 134 | +!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible. |
| 135 | +!!! error TS2322: Type 'string' is not assignable to type 'T'. |
68 | 136 | var b6: <T extends Base, U extends Derived>(x: (arg: T) => U) => T;
|
69 | 137 | a6 = b6; // ok
|
70 | 138 | b6 = a6; // ok
|
| 139 | + ~~ |
| 140 | +!!! error TS2322: Type '(x: (arg: Base) => Derived) => Base' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U) => T'. |
| 141 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 142 | +!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible. |
| 143 | +!!! error TS2322: Type 'Base' is not assignable to type 'T'. |
71 | 144 | var b7: <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U;
|
72 | 145 | a7 = b7; // ok
|
73 | 146 | b7 = a7; // ok
|
| 147 | + ~~ |
| 148 | +!!! error TS2322: Type '(x: (arg: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U'. |
| 149 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 150 | +!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible. |
| 151 | +!!! error TS2322: Type 'Base' is not assignable to type 'T'. |
74 | 152 | var b8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U;
|
75 | 153 | a8 = b8; // ok
|
76 | 154 | b8 = a8; // ok
|
| 155 | + ~~ |
| 156 | +!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U'. |
| 157 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 158 | +!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible. |
| 159 | +!!! error TS2322: Type 'Base' is not assignable to type 'T'. |
77 | 160 | var b9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U;
|
78 | 161 | a9 = b9; // ok
|
79 | 162 | b9 = a9; // ok
|
80 | 163 | ~~
|
81 | 164 | !!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U'.
|
82 |
| -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. |
83 |
| -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. |
84 |
| -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; bing: number; }'. |
85 |
| -!!! error TS2322: Property 'bing' is missing in type 'Base'. |
| 165 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 166 | +!!! error TS2322: Types of parameters 'arg' and 'arg' are incompatible. |
| 167 | +!!! error TS2322: Type 'Base' is not assignable to type 'T'. |
86 | 168 | var b10: <T extends Derived>(...x: T[]) => T;
|
87 | 169 | a10 = b10; // ok
|
88 | 170 | b10 = a10; // ok
|
| 171 | + ~~~ |
| 172 | +!!! error TS2322: Type '(...x: Derived[]) => Derived' is not assignable to type '<T extends Derived>(...x: T[]) => T'. |
| 173 | +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. |
89 | 174 | var b11: <T extends Base>(x: T, y: T) => T;
|
90 | 175 | a11 = b11; // ok
|
91 | 176 | b11 = a11; // ok
|
| 177 | + ~~~ |
| 178 | +!!! error TS2322: Type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type '<T extends Base>(x: T, y: T) => T'. |
| 179 | +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. |
| 180 | +!!! error TS2322: Type 'T' is not assignable to type '{ foo: string; bar: string; }'. |
| 181 | +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; bar: string; }'. |
| 182 | +!!! error TS2322: Property 'bar' is missing in type 'Base'. |
92 | 183 | var b12: <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>;
|
93 | 184 | a12 = b12; // ok
|
94 | 185 | b12 = a12; // ok
|
| 186 | + ~~~ |
| 187 | +!!! error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '<T extends Base[]>(x: Base[], y: T) => Derived[]'. |
| 188 | +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. |
| 189 | +!!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'. |
| 190 | +!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'. |
| 191 | +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. |
| 192 | +!!! error TS2322: Property 'baz' is missing in type 'Base'. |
95 | 193 | var b13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
|
96 | 194 | a13 = b13; // ok
|
97 | 195 | b13 = a13; // ok
|
| 196 | + ~~~ |
| 197 | +!!! error TS2322: Type '(x: Base[], y: Derived[]) => Derived[]' is not assignable to type '<T extends Derived[]>(x: Base[], y: T) => T'. |
| 198 | +!!! error TS2322: Type 'Derived[]' is not assignable to type 'T'. |
98 | 199 | var b14: <T>(x: { a: T; b: T }) => T;
|
99 | 200 | a14 = b14; // ok
|
100 | 201 | b14 = a14; // ok
|
| 202 | + ~~~ |
| 203 | +!!! error TS2322: Type '(x: { a: string; b: number; }) => Object' is not assignable to type '<T>(x: { a: T; b: T; }) => T'. |
| 204 | +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. |
| 205 | +!!! error TS2322: Type '{ a: T; b: T; }' is not assignable to type '{ a: string; b: number; }'. |
| 206 | +!!! error TS2322: Types of property 'a' are incompatible. |
| 207 | +!!! error TS2322: Type 'T' is not assignable to type 'string'. |
101 | 208 | var b15: <T>(x: T) => T[];
|
102 | 209 | a15 = b15; // ok
|
103 | 210 | b15 = a15; // ok
|
|
0 commit comments