From d96d16e10b1c307719314886a2a740735593a2e8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 20 Jul 2019 10:01:59 -0700 Subject: [PATCH] Add additional test --- .../typeInference/unionTypeInference.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;