We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc85bc5 commit 47f6bb2Copy full SHA for 47f6bb2
1 file changed
tests/cases/compiler/bestChoiceType.ts
@@ -0,0 +1,19 @@
1
+// @strictNullChecks: true
2
+
3
+// Repro from #10041
4
5
+(''.match(/ /) || []).map(s => s.toLowerCase());
6
7
+// Similar cases
8
9
+function f1() {
10
+ let x = ''.match(/ /);
11
+ let y = x || [];
12
+ let z = y.map(s => s.toLowerCase());
13
+}
14
15
+function f2() {
16
17
+ let y = x ? x : [];
18
19
0 commit comments