@@ -10,40 +10,86 @@ function* f1(): Generator<any, { x: 'x' }, any> {
10
10
>x : Symbol(x, Decl(generatorReturnContextualType.ts, 3, 10))
11
11
}
12
12
13
+ function* g1(): Iterator<any, { x: 'x' }, any> {
14
+ >g1 : Symbol(g1, Decl(generatorReturnContextualType.ts, 4, 1))
15
+ >Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --))
16
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 6, 31))
17
+
18
+ return { x: 'x' };
19
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 7, 10))
20
+ }
21
+
13
22
async function* f2(): AsyncGenerator<any, { x: 'x' }, any> {
14
- >f2 : Symbol(f2, Decl(generatorReturnContextualType.ts, 4 , 1))
23
+ >f2 : Symbol(f2, Decl(generatorReturnContextualType.ts, 8 , 1))
15
24
>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --))
16
- >x : Symbol(x, Decl(generatorReturnContextualType.ts, 6 , 43))
25
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 10 , 43))
17
26
18
27
return { x: 'x' };
19
- >x : Symbol(x, Decl(generatorReturnContextualType.ts, 7, 10))
28
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 11, 10))
29
+ }
30
+
31
+ async function* g2(): AsyncIterator<any, { x: 'x' }, any> {
32
+ >g2 : Symbol(g2, Decl(generatorReturnContextualType.ts, 12, 1))
33
+ >AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
34
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 14, 42))
35
+
36
+ return { x: 'x' };
37
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 15, 10))
20
38
}
21
39
22
40
async function* f3(): AsyncGenerator<any, { x: 'x' }, any> {
23
- >f3 : Symbol(f3, Decl(generatorReturnContextualType.ts, 8 , 1))
41
+ >f3 : Symbol(f3, Decl(generatorReturnContextualType.ts, 16 , 1))
24
42
>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --))
25
- >x : Symbol(x, Decl(generatorReturnContextualType.ts, 10, 43))
43
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 18, 43))
44
+
45
+ return Promise.resolve({ x: 'x' });
46
+ >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
47
+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
48
+ >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
49
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 19, 26))
50
+ }
51
+
52
+ async function* g3(): AsyncIterator<any, { x: 'x' }, any> {
53
+ >g3 : Symbol(g3, Decl(generatorReturnContextualType.ts, 20, 1))
54
+ >AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
55
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 22, 42))
26
56
27
57
return Promise.resolve({ x: 'x' });
28
58
>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
29
59
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
30
60
>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
31
- >x : Symbol(x, Decl(generatorReturnContextualType.ts, 11 , 26))
61
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 23 , 26))
32
62
}
33
63
34
64
async function* f4(): AsyncGenerator<any, { x: 'x' }, any> {
35
- >f4 : Symbol(f4, Decl(generatorReturnContextualType.ts, 12 , 1))
65
+ >f4 : Symbol(f4, Decl(generatorReturnContextualType.ts, 24 , 1))
36
66
>AsyncGenerator : Symbol(AsyncGenerator, Decl(lib.es2018.asyncgenerator.d.ts, --, --))
37
- >x : Symbol(x, Decl(generatorReturnContextualType.ts, 14, 43))
67
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 26, 43))
68
+
69
+ const ret = { x: 'x' };
70
+ >ret : Symbol(ret, Decl(generatorReturnContextualType.ts, 27, 7))
71
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 27, 15))
72
+
73
+ return Promise.resolve(ret); // Error
74
+ >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
75
+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
76
+ >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
77
+ >ret : Symbol(ret, Decl(generatorReturnContextualType.ts, 27, 7))
78
+ }
79
+
80
+ async function* g4(): AsyncIterator<any, { x: 'x' }, any> {
81
+ >g4 : Symbol(g4, Decl(generatorReturnContextualType.ts, 29, 1))
82
+ >AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
83
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 31, 42))
38
84
39
85
const ret = { x: 'x' };
40
- >ret : Symbol(ret, Decl(generatorReturnContextualType.ts, 15 , 7))
41
- >x : Symbol(x, Decl(generatorReturnContextualType.ts, 15 , 15))
86
+ >ret : Symbol(ret, Decl(generatorReturnContextualType.ts, 32 , 7))
87
+ >x : Symbol(x, Decl(generatorReturnContextualType.ts, 32 , 15))
42
88
43
89
return Promise.resolve(ret); // Error
44
90
>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
45
91
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
46
92
>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
47
- >ret : Symbol(ret, Decl(generatorReturnContextualType.ts, 15 , 7))
93
+ >ret : Symbol(ret, Decl(generatorReturnContextualType.ts, 32 , 7))
48
94
}
49
95
0 commit comments