-
Notifications
You must be signed in to change notification settings - Fork 12.8k
/
Copy pathtupleTypeInference2.symbols
91 lines (74 loc) · 3.54 KB
/
tupleTypeInference2.symbols
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
=== tests/cases/compiler/tupleTypeInference2.ts ===
// Repro from #22564
type A<R> = [R] | [R, string];
>A : Symbol(A, Decl(tupleTypeInference2.ts, 0, 0))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 2, 7))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 2, 7))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 2, 7))
declare function f<T>(x: A<T>): T;
>f : Symbol(f, Decl(tupleTypeInference2.ts, 2, 30))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 3, 19))
>x : Symbol(x, Decl(tupleTypeInference2.ts, 3, 22))
>A : Symbol(A, Decl(tupleTypeInference2.ts, 0, 0))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 3, 19))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 3, 19))
f([undefined, ''] as [never, string]); // T: never
>f : Symbol(f, Decl(tupleTypeInference2.ts, 2, 30))
>undefined : Symbol(undefined)
f([undefined, ''] as [void, string]); // T: void
>f : Symbol(f, Decl(tupleTypeInference2.ts, 2, 30))
>undefined : Symbol(undefined)
// Repro from #22563
type B<R, S> = [R] | [R, S];
>B : Symbol(B, Decl(tupleTypeInference2.ts, 5, 37))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 9, 7))
>S : Symbol(S, Decl(tupleTypeInference2.ts, 9, 9))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 9, 7))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 9, 7))
>S : Symbol(S, Decl(tupleTypeInference2.ts, 9, 9))
declare function g<T, U>(f: B<T, U>): U;
>g : Symbol(g, Decl(tupleTypeInference2.ts, 9, 28))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 10, 19))
>U : Symbol(U, Decl(tupleTypeInference2.ts, 10, 21))
>f : Symbol(f, Decl(tupleTypeInference2.ts, 10, 25))
>B : Symbol(B, Decl(tupleTypeInference2.ts, 5, 37))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 10, 19))
>U : Symbol(U, Decl(tupleTypeInference2.ts, 10, 21))
>U : Symbol(U, Decl(tupleTypeInference2.ts, 10, 21))
g([[]] as [void[]]); // U: {}
>g : Symbol(g, Decl(tupleTypeInference2.ts, 9, 28))
type C<R, S> = [R[]] | [R[], S];
>C : Symbol(C, Decl(tupleTypeInference2.ts, 11, 20))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 13, 7))
>S : Symbol(S, Decl(tupleTypeInference2.ts, 13, 9))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 13, 7))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 13, 7))
>S : Symbol(S, Decl(tupleTypeInference2.ts, 13, 9))
declare function h<T, U>(f: C<T, U>): U;
>h : Symbol(h, Decl(tupleTypeInference2.ts, 13, 32))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 14, 19))
>U : Symbol(U, Decl(tupleTypeInference2.ts, 14, 21))
>f : Symbol(f, Decl(tupleTypeInference2.ts, 14, 25))
>C : Symbol(C, Decl(tupleTypeInference2.ts, 11, 20))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 14, 19))
>U : Symbol(U, Decl(tupleTypeInference2.ts, 14, 21))
>U : Symbol(U, Decl(tupleTypeInference2.ts, 14, 21))
h([[]] as [void[]]); // U: {}
>h : Symbol(h, Decl(tupleTypeInference2.ts, 13, 32))
// Repro from #22562
type C2<R> = [R[]] | [R[], void];
>C2 : Symbol(C2, Decl(tupleTypeInference2.ts, 15, 20))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 19, 8))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 19, 8))
>R : Symbol(R, Decl(tupleTypeInference2.ts, 19, 8))
declare function h2<T>(f: C2<T>): T;
>h2 : Symbol(h2, Decl(tupleTypeInference2.ts, 19, 33))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 20, 20))
>f : Symbol(f, Decl(tupleTypeInference2.ts, 20, 23))
>C2 : Symbol(C2, Decl(tupleTypeInference2.ts, 15, 20))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 20, 20))
>T : Symbol(T, Decl(tupleTypeInference2.ts, 20, 20))
h2([[]] as [never[]]); // T: never
>h2 : Symbol(h2, Decl(tupleTypeInference2.ts, 19, 33))
h2([[]] as [void[]]); // T: void
>h2 : Symbol(h2, Decl(tupleTypeInference2.ts, 19, 33))