We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb87332 commit ec38799Copy full SHA for ec38799
tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference3.ts
@@ -40,3 +40,17 @@ declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
40
41
g1 = g2;
42
g2 = g1;
43
+
44
+// Repro from #32572
45
46
+declare function foo1<T>(obj: string[] & Iterable<T>): T;
47
+declare function foo2<T>(obj: string[] & T): T;
48
49
+declare let sa: string[];
50
+declare let sx: string[] & { extra: number };
51
52
+let x1 = foo1(sa); // string
53
+let y1 = foo1(sx); // string
54
55
+let x2 = foo2(sa); // unknown
56
+let y2 = foo2(sx); // { extra: number }
0 commit comments