Skip to content

Commit d96d16e

Browse files
committed
Add additional test
1 parent 2450c19 commit d96d16e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ const d1 = f4("abc");
3232
const d2 = f4(s);
3333
const d3 = f4(42); // Error
3434

35+
export interface Foo<T> {
36+
then<U>(f: (x: T) => U | Foo<U>, g: U): Foo<U>;
37+
}
38+
export interface Bar<T> {
39+
then<S>(f: (x: T) => S | Bar<S>, g: S): Bar<S>;
40+
}
41+
42+
function qux(p1: Foo<void>, p2: Bar<void>) {
43+
p1 = p2;
44+
}
45+
3546
// Repros from #32434
3647

3748
declare function foo<T>(x: T | Promise<T>): void;

0 commit comments

Comments
 (0)