File: excessivelyLargeTupleSpread.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (54 lines) | stat: -rw-r--r-- 2,389 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
44
45
46
47
48
49
50
51
52
53
54
tests/cases/compiler/excessivelyLargeTupleSpread.ts(6,10): error TS2589: Type instantiation is excessively deep and possibly infinite.
tests/cases/compiler/excessivelyLargeTupleSpread.ts(6,10): error TS2799: Type produces a tuple type that is too large to represent.
tests/cases/compiler/excessivelyLargeTupleSpread.ts(22,12): error TS2799: Type produces a tuple type that is too large to represent.
tests/cases/compiler/excessivelyLargeTupleSpread.ts(38,13): error TS2800: Expression produces a tuple type that is too large to represent.


==== tests/cases/compiler/excessivelyLargeTupleSpread.ts (4 errors) ====
    // #41771
    
    type BuildTuple<L extends number, T extends any[] = [any]> = 
        T['length'] extends L ? T : BuildTuple<L, [...T, ...T]>;
    
    type A = BuildTuple<3>
             ~~~~~~~~~~~~~
!!! error TS2589: Type instantiation is excessively deep and possibly infinite.
             ~~~~~~~~~~~~~
!!! error TS2799: Type produces a tuple type that is too large to represent.
    
    type T0 = [any];
    type T1 = [...T0, ...T0];
    type T2 = [...T1, ...T1];
    type T3 = [...T2, ...T2];
    type T4 = [...T3, ...T3];
    type T5 = [...T4, ...T4];
    type T6 = [...T5, ...T5];
    type T7 = [...T6, ...T6];
    type T8 = [...T7, ...T7];
    type T9 = [...T8, ...T8];
    type T10 = [...T9, ...T9];
    type T11 = [...T10, ...T10];
    type T12 = [...T11, ...T11];
    type T13 = [...T12, ...T12];
    type T14 = [...T13, ...T13]; // 2^14 > 10,000
               ~~~~~~~~~~~~~~~~
!!! error TS2799: Type produces a tuple type that is too large to represent.
    
    const a0 = [0] as const;
    const a1 = [...a0, ...a0] as const;
    const a2 = [...a1, ...a1] as const;
    const a3 = [...a2, ...a2] as const;
    const a4 = [...a3, ...a3] as const;
    const a5 = [...a4, ...a4] as const;
    const a6 = [...a5, ...a5] as const;
    const a7 = [...a6, ...a6] as const;
    const a8 = [...a7, ...a7] as const;
    const a9 = [...a8, ...a8] as const;
    const a10 = [...a9, ...a9] as const;
    const a11 = [...a10, ...a10] as const;
    const a12 = [...a11, ...a11] as const;
    const a13 = [...a12, ...a12] as const;
    const a14 = [...a13, ...a13] as const; // 2^14 > 10,000
                ~~~~~~~~~~~~~~~~
!!! error TS2800: Expression produces a tuple type that is too large to represent.