diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts b/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts index ccedb753354..4d9a3eae21e 100644 --- a/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts +++ b/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts @@ -32,6 +32,17 @@ const d1 = f4("abc"); const d2 = f4(s); const d3 = f4(42); // Error +export interface Foo { + then(f: (x: T) => U | Foo, g: U): Foo; +} +export interface Bar { + then(f: (x: T) => S | Bar, g: S): Bar; +} + +function qux(p1: Foo, p2: Bar) { + p1 = p2; +} + // Repros from #32434 declare function foo(x: T | Promise): void;