We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d415b57 commit eeaa752Copy full SHA for eeaa752
1 file changed
tests/cases/conformance/controlFlow/assertionTypePredicates1.ts
@@ -37,6 +37,14 @@ function f01(x: unknown) {
37
assertDefined(x);
38
x; // string
39
}
40
+ if (!!true) {
41
+ assert(false);
42
+ x; // Unreachable
43
+ }
44
45
+ assert(false && x === undefined);
46
47
48
49
50
function f02(x: string | undefined) {
@@ -77,6 +85,10 @@ function f10(x: string | undefined) {
77
85
Debug.assertDefined(x);
78
86
x.length;
79
87
88
89
+ Debug.assert(false);
90
91
80
92
81
93
82
94
class Test {
@@ -108,6 +120,10 @@ class Test {
108
120
this.assertIsTest2();
109
121
this.z;
110
122
123
+ baz(x: number) {
124
+ this.assert(false);
125
126
111
127
112
128
113
129
class Test2 extends Test {
0 commit comments