-
Notifications
You must be signed in to change notification settings - Fork 12.8k
/
Copy pathstrictFunctionTypes1.symbols
217 lines (184 loc) · 10.1 KB
/
strictFunctionTypes1.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
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
=== tests/cases/compiler/strictFunctionTypes1.ts ===
declare function f1<T>(f1: (x: T) => void, f2: (x: T) => void): (x: T) => void;
>f1 : Symbol(f1, Decl(strictFunctionTypes1.ts, 0, 0))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 0, 20))
>f1 : Symbol(f1, Decl(strictFunctionTypes1.ts, 0, 23))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 0, 28))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 0, 20))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 0, 42))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 0, 48))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 0, 20))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 0, 65))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 0, 20))
declare function f2<T>(obj: T, f1: (x: T) => void, f2: (x: T) => void): T;
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 0, 79))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 1, 20))
>obj : Symbol(obj, Decl(strictFunctionTypes1.ts, 1, 23))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 1, 20))
>f1 : Symbol(f1, Decl(strictFunctionTypes1.ts, 1, 30))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 1, 36))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 1, 20))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 1, 50))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 1, 56))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 1, 20))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 1, 20))
declare function f3<T>(obj: T, f1: (x: T) => void, f2: (f: (x: T) => void) => void): T;
>f3 : Symbol(f3, Decl(strictFunctionTypes1.ts, 1, 74))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 2, 20))
>obj : Symbol(obj, Decl(strictFunctionTypes1.ts, 2, 23))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 2, 20))
>f1 : Symbol(f1, Decl(strictFunctionTypes1.ts, 2, 30))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 2, 36))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 2, 20))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 2, 50))
>f : Symbol(f, Decl(strictFunctionTypes1.ts, 2, 56))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 2, 60))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 2, 20))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 2, 20))
interface Func<T> { (x: T): void }
>Func : Symbol(Func, Decl(strictFunctionTypes1.ts, 2, 87))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 4, 15))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 4, 21))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 4, 15))
declare function f4<T>(f1: Func<T>, f2: Func<T>): Func<T>;
>f4 : Symbol(f4, Decl(strictFunctionTypes1.ts, 4, 34))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 6, 20))
>f1 : Symbol(f1, Decl(strictFunctionTypes1.ts, 6, 23))
>Func : Symbol(Func, Decl(strictFunctionTypes1.ts, 2, 87))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 6, 20))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 6, 35))
>Func : Symbol(Func, Decl(strictFunctionTypes1.ts, 2, 87))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 6, 20))
>Func : Symbol(Func, Decl(strictFunctionTypes1.ts, 2, 87))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 6, 20))
declare function fo(x: Object): void;
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 8, 20))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
declare function fs(x: string): void;
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 9, 20))
declare function fx(f: (x: "def") => void): void;
>fx : Symbol(fx, Decl(strictFunctionTypes1.ts, 9, 37))
>f : Symbol(f, Decl(strictFunctionTypes1.ts, 10, 20))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 10, 24))
const x1 = f1(fo, fs); // (x: string) => void
>x1 : Symbol(x1, Decl(strictFunctionTypes1.ts, 12, 5))
>f1 : Symbol(f1, Decl(strictFunctionTypes1.ts, 0, 0))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
const x2 = f2("abc", fo, fs); // "abc"
>x2 : Symbol(x2, Decl(strictFunctionTypes1.ts, 13, 5))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 0, 79))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
const x3 = f3("abc", fo, fx); // "abc" | "def"
>x3 : Symbol(x3, Decl(strictFunctionTypes1.ts, 14, 5))
>f3 : Symbol(f3, Decl(strictFunctionTypes1.ts, 1, 74))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fx : Symbol(fx, Decl(strictFunctionTypes1.ts, 9, 37))
const x4 = f4(fo, fs); // Func<string>
>x4 : Symbol(x4, Decl(strictFunctionTypes1.ts, 15, 5))
>f4 : Symbol(f4, Decl(strictFunctionTypes1.ts, 4, 34))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
declare const never: never;
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
const x10 = f2(never, fo, fs); // string
>x10 : Symbol(x10, Decl(strictFunctionTypes1.ts, 19, 5))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 0, 79))
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
const x11 = f3(never, fo, fx); // "def"
>x11 : Symbol(x11, Decl(strictFunctionTypes1.ts, 20, 5))
>f3 : Symbol(f3, Decl(strictFunctionTypes1.ts, 1, 74))
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fx : Symbol(fx, Decl(strictFunctionTypes1.ts, 9, 37))
// Repro from #21112
declare function foo<T>(a: ReadonlyArray<T>): T;
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
>a : Symbol(a, Decl(strictFunctionTypes1.ts, 24, 24))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
let x = foo([]); // never
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 25, 3))
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))
// Modified repros from #26127
interface A { a: string }
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
>a : Symbol(A.a, Decl(strictFunctionTypes1.ts, 29, 13))
interface B extends A { b: string }
>B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
>b : Symbol(B.b, Decl(strictFunctionTypes1.ts, 30, 23))
declare function acceptUnion(x: A | number): void;
>acceptUnion : Symbol(acceptUnion, Decl(strictFunctionTypes1.ts, 30, 35))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 32, 29))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
declare function acceptA(x: A): void;
>acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 33, 25))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
declare let a: A;
>a : Symbol(a, Decl(strictFunctionTypes1.ts, 35, 11))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
declare let b: B;
>b : Symbol(b, Decl(strictFunctionTypes1.ts, 36, 11))
>B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
declare function coAndContra<T>(value: T, func: (t: T) => void): T;
>coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
>value : Symbol(value, Decl(strictFunctionTypes1.ts, 38, 32))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
>func : Symbol(func, Decl(strictFunctionTypes1.ts, 38, 41))
>t : Symbol(t, Decl(strictFunctionTypes1.ts, 38, 49))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 38, 29))
const t1: A = coAndContra(a, acceptUnion);
>t1 : Symbol(t1, Decl(strictFunctionTypes1.ts, 40, 5))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
>coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
>a : Symbol(a, Decl(strictFunctionTypes1.ts, 35, 11))
>acceptUnion : Symbol(acceptUnion, Decl(strictFunctionTypes1.ts, 30, 35))
const t2: B = coAndContra(b, acceptA);
>t2 : Symbol(t2, Decl(strictFunctionTypes1.ts, 41, 5))
>B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
>coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
>b : Symbol(b, Decl(strictFunctionTypes1.ts, 36, 11))
>acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
const t3: A = coAndContra(never, acceptA);
>t3 : Symbol(t3, Decl(strictFunctionTypes1.ts, 42, 5))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
>coAndContra : Symbol(coAndContra, Decl(strictFunctionTypes1.ts, 36, 17))
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
>acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
declare function coAndContraArray<T>(value: T[], func: (t: T) => void): T[];
>coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
>value : Symbol(value, Decl(strictFunctionTypes1.ts, 44, 37))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
>func : Symbol(func, Decl(strictFunctionTypes1.ts, 44, 48))
>t : Symbol(t, Decl(strictFunctionTypes1.ts, 44, 56))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 44, 34))
const t4: A[] = coAndContraArray([a], acceptUnion);
>t4 : Symbol(t4, Decl(strictFunctionTypes1.ts, 46, 5))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
>coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
>a : Symbol(a, Decl(strictFunctionTypes1.ts, 35, 11))
>acceptUnion : Symbol(acceptUnion, Decl(strictFunctionTypes1.ts, 30, 35))
const t5: B[] = coAndContraArray([b], acceptA);
>t5 : Symbol(t5, Decl(strictFunctionTypes1.ts, 47, 5))
>B : Symbol(B, Decl(strictFunctionTypes1.ts, 29, 25))
>coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
>b : Symbol(b, Decl(strictFunctionTypes1.ts, 36, 11))
>acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))
const t6: A[] = coAndContraArray([], acceptA);
>t6 : Symbol(t6, Decl(strictFunctionTypes1.ts, 48, 5))
>A : Symbol(A, Decl(strictFunctionTypes1.ts, 25, 16))
>coAndContraArray : Symbol(coAndContraArray, Decl(strictFunctionTypes1.ts, 42, 42))
>acceptA : Symbol(acceptA, Decl(strictFunctionTypes1.ts, 32, 50))