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) {
3737 assertDefined ( x ) ;
3838 x ; // string
3939 }
40+ if ( ! ! true ) {
41+ assert ( false ) ;
42+ x ; // Unreachable
43+ }
44+ if ( ! ! true ) {
45+ assert ( false && x === undefined ) ;
46+ x ; // Unreachable
47+ }
4048}
4149
4250function f02 ( x : string | undefined ) {
@@ -77,6 +85,10 @@ function f10(x: string | undefined) {
7785 Debug . assertDefined ( x ) ;
7886 x . length ;
7987 }
88+ if ( ! ! true ) {
89+ Debug . assert ( false ) ;
90+ x ; // Unreachable
91+ }
8092}
8193
8294class Test {
@@ -108,6 +120,10 @@ class Test {
108120 this . assertIsTest2 ( ) ;
109121 this . z ;
110122 }
123+ baz ( x : number ) {
124+ this . assert ( false ) ;
125+ x ; // Unreachable
126+ }
111127}
112128
113129class Test2 extends Test {
You can’t perform that action at this time.
0 commit comments