File: subtypesOfTypeParameterWithRecursiveConstraints.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (304 lines) | stat: -rw-r--r-- 17,234 bytes parent folder | download
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.
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'.


==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts (24 errors) ====
    // checking whether other types are subtypes of type parameters with constraints
    
    class Foo<T> { foo: T; }
    function f<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>>(t: T, u: U, v: V) {
        // ok
        var r1 = true ? t : u;
        var r1 = true ? u : t;
    
        // ok
        var r2 = true ? t : v;
        var r2 = true ? v : t;
    
        // ok
        var r3 = true ? v : u;
        var r3 = true ? u : v;
    
        // ok
        var r4 = true ? t : new Foo<T>();
        var r4 = true ? new Foo<T>() : t;
    
        // ok
        var r5 = true ? u : new Foo<T>();
        var r5 = true ? new Foo<T>() : u;
    
        // ok
        var r6 = true ? v : new Foo<T>();
        var r6 = true ? new Foo<T>() : v;
    
    
        // ok
        var r7 = true ? t : new Foo<U>();
        var r7 = true ? new Foo<U>() : t;
    
        // ok
        var r8 = true ? u : new Foo<U>();
        var r8 = true ? new Foo<U>() : u;
    
        // ok
        var r9 = true ? v : new Foo<U>();
        var r9 = true ? new Foo<U>() : v;
    
    
        // ok
        var r10 = true ? t : new Foo<V>();
        var r10 = true ? new Foo<V>() : t;
    
        // ok
        var r11 = true ? u : new Foo<V>();
        var r11 = true ? new Foo<V>() : u;
    
        // ok
        var r12 = true ? v : new Foo<V>();
        var r12 = true ? new Foo<V>() : v;
    }
    
    module M1 {
        class Base<T> {
            foo: T;
        }
    
        class D1<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> {
            [x: string]: T;
            foo: T
        }
    
        class D2<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> {
            [x: string]: T;
            foo: U
            ~~~
!!! error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
            ~~~
!!! 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'.
        }
    
        class D3<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<T> {
            [x: string]: T;
            foo: V
            ~~~
!!! error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'.
            ~~~
!!! 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'.
        }
    
        class D4<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> {
            [x: string]: U;
            foo: T
            ~~~
!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'.
            ~~~
!!! 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'.
        }
    
        class D5<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> {
            [x: string]: U;
            foo: U
        }
    
        class D6<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<U> {
            [x: string]: U;
            foo: V
            ~~~
!!! error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'.
            ~~~
!!! 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'.
        }
    
        class D7<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> {
            [x: string]: V;
            foo: T
            ~~~
!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'.
            ~~~
!!! 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'.
        }
    
        class D8<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> {
            [x: string]: V;
            foo: U
            ~~~
!!! error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'.
            ~~~
!!! 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'.
        }
    
        class D9<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base<V> {
            [x: string]: V;
            foo: V
        }
    }
    
    
    module M2 {
        class Base2<T> {
            foo: Foo<T>;
        }
    
        class D1<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<T> {
            [x: string]: T;
            foo: T
            ~~~
!!! error TS2416: Property 'foo' in type 'D1<T, U, V>' is not assignable to the same property in base type 'Base2<T>'.
!!! 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'.
        }
    
        class D2<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<T> {
            [x: string]: T;
            foo: U
            ~~~
!!! error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'.
        }
    
        class D3<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<T> {
            [x: string]: T;
            foo: V
            ~~~
!!! error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'.
            ~~~
!!! error TS2416: Property 'foo' in type 'D3<T, U, V>' is not assignable to the same property in base type 'Base2<T>'.
!!! 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'.
        }
    
        class D4<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<U> {
            [x: string]: U;
            foo: T
            ~~~
!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'.
        }
    
        class D5<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<U> {
            [x: string]: U;
            foo: U
            ~~~
!!! error TS2416: Property 'foo' in type 'D5<T, U, V>' is not assignable to the same property in base type 'Base2<U>'.
!!! 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'.
        }
    
        class D6<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<U> {
            [x: string]: U;
            foo: V
            ~~~
!!! error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'.
            ~~~
!!! error TS2416: Property 'foo' in type 'D6<T, U, V>' is not assignable to the same property in base type 'Base2<U>'.
!!! 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'.
        }
    
        class D7<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<V> {
            [x: string]: V;
            foo: T
            ~~~
!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'.
            ~~~
!!! error TS2416: Property 'foo' in type 'D7<T, U, V>' is not assignable to the same property in base type 'Base2<V>'.
!!! 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'.
        }
    
        class D8<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<V> {
            [x: string]: V;
            foo: U
            ~~~
!!! error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'.
            ~~~
!!! error TS2416: Property 'foo' in type 'D8<T, U, V>' is not assignable to the same property in base type 'Base2<V>'.
!!! 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'.
        }
    
        class D9<T extends Foo<U>, U extends Foo<T>, V extends Foo<V>> extends Base2<V> {
            [x: string]: V;
            foo: V
        }
    }