Skip to content

Commit 7b1ca04

Browse files
committed
Add regression test
1 parent ed33801 commit 7b1ca04

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Repro from #11000
2+
3+
declare var cond: boolean;
4+
5+
function foo1() {
6+
let x: string | number | boolean = 0;
7+
while (cond) {
8+
if (typeof x === "string") {
9+
x = x.slice();
10+
}
11+
else {
12+
x = "abc";
13+
}
14+
}
15+
}
16+
17+
function foo2() {
18+
let x: string | number | boolean = 0;
19+
while (cond) {
20+
if (typeof x === "number") {
21+
x = "abc";
22+
}
23+
else {
24+
x = x.slice();
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)