diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts b/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts index 17057de2b84..d64b1973695 100644 --- a/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts +++ b/tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts @@ -40,3 +40,17 @@ declare let g2: (x: Foo2 | Bar2) => Promise; g1 = g2; g2 = g1; + +// Repro from #32572 + +declare function foo1(obj: string[] & Iterable): T; +declare function foo2(obj: string[] & T): T; + +declare let sa: string[]; +declare let sx: string[] & { extra: number }; + +let x1 = foo1(sa); // string +let y1 = foo1(sx); // string + +let x2 = foo2(sa); // unknown +let y2 = foo2(sx); // { extra: number }