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 ed33801 commit 7b1ca04Copy full SHA for 7b1ca04
tests/cases/compiler/controlFlowWithIncompleteTypes.ts
@@ -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
19
20
+ if (typeof x === "number") {
21
22
23
24
25
26
27
0 commit comments