forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecursiveConditionalCrash5.types
More file actions
42 lines (31 loc) · 977 Bytes
/
recursiveConditionalCrash5.types
File metadata and controls
42 lines (31 loc) · 977 Bytes
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
//// [tests/cases/compiler/recursiveConditionalCrash5.ts] ////
=== Performance Stats ===
Instantiation count: 5,000
=== recursiveConditionalCrash5.ts ===
// https://github.com/microsoft/TypeScript/issues/62966
type Prepend<Elm, T extends unknown[]> = T extends unknown
>Prepend : Prepend<Elm, T>
> : ^^^^^^^^^^^^^^^
? ((arg: Elm, ...rest: T) => void) extends (...args: infer T2) => void
>arg : Elm
> : ^^^
>rest : T
> : ^
>args : T2
> : ^^
? T2
: never
: never;
type ExactExtract<T, U> = (T extends U ? U extends T ? T : never : never) & string;
>ExactExtract : ExactExtract<T, U>
> : ^^^^^^^^^^^^^^^^^^
type Conv<T, U = T> = {
>Conv : Conv<T, U>
> : ^^^^^^^^^^
0: [T];
>0 : [T]
> : ^^^
1: Prepend<T, Conv<ExactExtract<U, T>>>;
>1 : Prepend<T, Conv<ExactExtract<U, T>, ExactExtract<U, T>>>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}[U extends T ? 0 : 1];