File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
tests/cases/conformance/controlFlow Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ function f01(x: unknown) {
37
37
assertDefined ( x ) ;
38
38
x ; // string
39
39
}
40
+ if ( ! ! true ) {
41
+ assert ( false ) ;
42
+ x ; // Unreachable
43
+ }
44
+ if ( ! ! true ) {
45
+ assert ( false && x === undefined ) ;
46
+ x ; // Unreachable
47
+ }
40
48
}
41
49
42
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
+ if ( ! ! true ) {
89
+ Debug . assert ( false ) ;
90
+ x ; // Unreachable
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
+ x ; // Unreachable
126
+ }
111
127
}
112
128
113
129
class Test2 extends Test {
You can’t perform that action at this time.
0 commit comments