We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b980216 commit 3d4c14cCopy full SHA for 3d4c14c
1 file changed
tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator1.ts
@@ -1,4 +1,5 @@
1
// @strict: true
2
+// @allowUnreachableCode: false
3
4
declare const a1: string | undefined | null
5
declare const a2: string | undefined | null
@@ -39,4 +40,28 @@ const cc4 = c4 ?? true;
39
40
const dd1 = d1 ?? {b: 1};
41
const dd2 = d2 ?? {b: 1};
42
const dd3 = d3 ?? {b: 1};
-const dd4 = d4 ?? {b: 1};
43
+const dd4 = d4 ?? {b: 1};
44
+
45
+// Repro from #34635
46
47
+declare function foo(): void;
48
49
+const maybeBool = false;
50
51
+if (!(maybeBool ?? true)) {
52
+ foo();
53
+}
54
55
+if (maybeBool ?? true) {
56
57
58
+else {
59
60
61
62
+if (false ?? true) {
63
64
65
66
67
0 commit comments