Skip to content

Commit b9d27c0

Browse files
committed
Add regression tests
1 parent 35de142 commit b9d27c0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
11
// @strict: true
2+
// @target: esnext
23

34
// Repro from #30720
45

56
type Maybe<T> = T | undefined;
67
declare function concatMaybe<T>(...args: (Maybe<T> | Maybe<T>[])[]): T[];
78
concatMaybe([1, 2, 3], 4);
9+
10+
// Repros from #32247
11+
12+
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> => {
13+
throw com;
14+
};
15+
16+
interface Foo1<T> {
17+
test(value: T): void;
18+
}
19+
20+
interface Bar1<T> {
21+
test(value: T | PromiseLike<T>): void;
22+
}
23+
24+
declare let f1: <T>(x: Foo1<T> | Bar1<T>) => Promise<T>;
25+
declare let f2: <U>(x: Foo1<U> | Bar1<U>) => Promise<U>;
26+
27+
f1 = f2;
28+
f2 = f1;
29+
30+
type Foo2<T> = {
31+
test(value: T): void;
32+
}
33+
34+
type Bar2<T> = {
35+
test(value: T | PromiseLike<T>): void;
36+
}
37+
38+
declare let g1: <T>(x: Foo2<T> | Bar2<T>) => Promise<T>;
39+
declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
40+
41+
g1 = g2;
42+
g2 = g1;

0 commit comments

Comments
 (0)