Skip to content

Commit 3e93461

Browse files
committed
Add regression test
1 parent 93acaac commit 3e93461

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/cases/compiler/discriminantPropertyCheck.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,25 @@ function func2(inst: Instance) {
9999
}
100100
}
101101
}
102+
103+
// Repro from #29106
104+
105+
const f = (_a: string, _b: string): void => {};
106+
107+
interface A {
108+
a?: string;
109+
b?: string;
110+
}
111+
112+
interface B {
113+
a: string;
114+
b: string;
115+
}
116+
117+
type U = A | B;
118+
119+
const u: U = {} as any;
120+
121+
u.a && u.b && f(u.a, u.b);
122+
123+
u.b && u.a && f(u.a, u.b);

0 commit comments

Comments
 (0)