File: deeplyNestedConstraints.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (43 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download | duplicates (3)
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
=== tests/cases/compiler/deeplyNestedConstraints.ts ===
// Repro from #41931

type Enum = Record<string, string | number>;
>Enum : Symbol(Enum, Decl(deeplyNestedConstraints.ts, 0, 0))
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))

type TypeMap<E extends Enum> = { [key in E[keyof E]]: number | boolean | string | number[] };
>TypeMap : Symbol(TypeMap, Decl(deeplyNestedConstraints.ts, 2, 44))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 4, 13))
>Enum : Symbol(Enum, Decl(deeplyNestedConstraints.ts, 0, 0))
>key : Symbol(key, Decl(deeplyNestedConstraints.ts, 4, 34))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 4, 13))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 4, 13))

class BufferPool<E extends Enum, M extends TypeMap<E>> {
>BufferPool : Symbol(BufferPool, Decl(deeplyNestedConstraints.ts, 4, 93))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 6, 17))
>Enum : Symbol(Enum, Decl(deeplyNestedConstraints.ts, 0, 0))
>M : Symbol(M, Decl(deeplyNestedConstraints.ts, 6, 32))
>TypeMap : Symbol(TypeMap, Decl(deeplyNestedConstraints.ts, 2, 44))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 6, 17))

    setArray2<K extends E[keyof E]>(_: K, array: Extract<M[K], ArrayLike<any>>) {
>setArray2 : Symbol(BufferPool.setArray2, Decl(deeplyNestedConstraints.ts, 6, 56))
>K : Symbol(K, Decl(deeplyNestedConstraints.ts, 7, 14))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 6, 17))
>E : Symbol(E, Decl(deeplyNestedConstraints.ts, 6, 17))
>_ : Symbol(_, Decl(deeplyNestedConstraints.ts, 7, 36))
>K : Symbol(K, Decl(deeplyNestedConstraints.ts, 7, 14))
>array : Symbol(array, Decl(deeplyNestedConstraints.ts, 7, 41))
>Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --))
>M : Symbol(M, Decl(deeplyNestedConstraints.ts, 6, 32))
>K : Symbol(K, Decl(deeplyNestedConstraints.ts, 7, 14))
>ArrayLike : Symbol(ArrayLike, Decl(lib.es5.d.ts, --, --))

        array.length; // Requires exploration of >5 levels of constraints
>array.length : Symbol(length, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>array : Symbol(array, Decl(deeplyNestedConstraints.ts, 7, 41))
>length : Symbol(length, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
    }
}