@@ -19,3 +19,145 @@ declare function concatMaybe<T>(...args: (Maybe<T> | Maybe<T>[])[]): T[];
19
19
concatMaybe([1, 2, 3], 4);
20
20
>concatMaybe : Symbol(concatMaybe, Decl(unionAndIntersectionInference3.ts, 2, 30))
21
21
22
+ // Repros from #32247
23
+
24
+ const g: <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>) => Promise<U> = async <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>): Promise<U> => {
25
+ >g : Symbol(g, Decl(unionAndIntersectionInference3.ts, 8, 5))
26
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
27
+ >R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 12))
28
+ >S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 15))
29
+ >com : Symbol(com, Decl(unionAndIntersectionInference3.ts, 8, 19))
30
+ >Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --))
31
+ >S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 15))
32
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
33
+ >R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 12))
34
+ >AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
35
+ >S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 15))
36
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
37
+ >R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 12))
38
+ >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, --, --))
39
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
40
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
41
+ >R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 99))
42
+ >S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 102))
43
+ >com : Symbol(com, Decl(unionAndIntersectionInference3.ts, 8, 106))
44
+ >Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --))
45
+ >S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 102))
46
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
47
+ >R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 99))
48
+ >AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
49
+ >S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 102))
50
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
51
+ >R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 99))
52
+ >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, --, --))
53
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
54
+
55
+ throw com;
56
+ >com : Symbol(com, Decl(unionAndIntersectionInference3.ts, 8, 106))
57
+
58
+ };
59
+
60
+ interface Foo1<T> {
61
+ >Foo1 : Symbol(Foo1, Decl(unionAndIntersectionInference3.ts, 10, 2))
62
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 12, 15))
63
+
64
+ test(value: T): void;
65
+ >test : Symbol(Foo1.test, Decl(unionAndIntersectionInference3.ts, 12, 19))
66
+ >value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 13, 9))
67
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 12, 15))
68
+ }
69
+
70
+ interface Bar1<T> {
71
+ >Bar1 : Symbol(Bar1, Decl(unionAndIntersectionInference3.ts, 14, 1))
72
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 16, 15))
73
+
74
+ test(value: T | PromiseLike<T>): void;
75
+ >test : Symbol(Bar1.test, Decl(unionAndIntersectionInference3.ts, 16, 19))
76
+ >value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 17, 9))
77
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 16, 15))
78
+ >PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
79
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 16, 15))
80
+ }
81
+
82
+ declare let f1: <T>(x: Foo1<T> | Bar1<T>) => Promise<T>;
83
+ >f1 : Symbol(f1, Decl(unionAndIntersectionInference3.ts, 20, 11))
84
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
85
+ >x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 20, 20))
86
+ >Foo1 : Symbol(Foo1, Decl(unionAndIntersectionInference3.ts, 10, 2))
87
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
88
+ >Bar1 : Symbol(Bar1, Decl(unionAndIntersectionInference3.ts, 14, 1))
89
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
90
+ >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, --, --))
91
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
92
+
93
+ declare let f2: <U>(x: Foo1<U> | Bar1<U>) => Promise<U>;
94
+ >f2 : Symbol(f2, Decl(unionAndIntersectionInference3.ts, 21, 11))
95
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
96
+ >x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 21, 20))
97
+ >Foo1 : Symbol(Foo1, Decl(unionAndIntersectionInference3.ts, 10, 2))
98
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
99
+ >Bar1 : Symbol(Bar1, Decl(unionAndIntersectionInference3.ts, 14, 1))
100
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
101
+ >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, --, --))
102
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
103
+
104
+ f1 = f2;
105
+ >f1 : Symbol(f1, Decl(unionAndIntersectionInference3.ts, 20, 11))
106
+ >f2 : Symbol(f2, Decl(unionAndIntersectionInference3.ts, 21, 11))
107
+
108
+ f2 = f1;
109
+ >f2 : Symbol(f2, Decl(unionAndIntersectionInference3.ts, 21, 11))
110
+ >f1 : Symbol(f1, Decl(unionAndIntersectionInference3.ts, 20, 11))
111
+
112
+ type Foo2<T> = {
113
+ >Foo2 : Symbol(Foo2, Decl(unionAndIntersectionInference3.ts, 24, 8))
114
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 26, 10))
115
+
116
+ test(value: T): void;
117
+ >test : Symbol(test, Decl(unionAndIntersectionInference3.ts, 26, 16))
118
+ >value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 27, 9))
119
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 26, 10))
120
+ }
121
+
122
+ type Bar2<T> = {
123
+ >Bar2 : Symbol(Bar2, Decl(unionAndIntersectionInference3.ts, 28, 1))
124
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 30, 10))
125
+
126
+ test(value: T | PromiseLike<T>): void;
127
+ >test : Symbol(test, Decl(unionAndIntersectionInference3.ts, 30, 16))
128
+ >value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 31, 9))
129
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 30, 10))
130
+ >PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
131
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 30, 10))
132
+ }
133
+
134
+ declare let g1: <T>(x: Foo2<T> | Bar2<T>) => Promise<T>;
135
+ >g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
136
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
137
+ >x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 34, 20))
138
+ >Foo2 : Symbol(Foo2, Decl(unionAndIntersectionInference3.ts, 24, 8))
139
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
140
+ >Bar2 : Symbol(Bar2, Decl(unionAndIntersectionInference3.ts, 28, 1))
141
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
142
+ >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, --, --))
143
+ >T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
144
+
145
+ declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
146
+ >g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
147
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
148
+ >x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 35, 20))
149
+ >Foo2 : Symbol(Foo2, Decl(unionAndIntersectionInference3.ts, 24, 8))
150
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
151
+ >Bar2 : Symbol(Bar2, Decl(unionAndIntersectionInference3.ts, 28, 1))
152
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
153
+ >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, --, --))
154
+ >U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
155
+
156
+ g1 = g2;
157
+ >g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
158
+ >g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
159
+
160
+ g2 = g1;
161
+ >g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
162
+ >g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
163
+
0 commit comments