Files
kotlin-fork/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2845.fir.kt
T
2020-06-19 15:53:09 +03:00

19 lines
415 B
Kotlin
Vendored

//KT-2845 Wrong cf-analysys for variable initialization in try..finally
package h
import java.util.ArrayList
private fun doTest() : Int {
var list : MutableList<Int>? ;
try {
list = ArrayList()
// Not-null was just assigned to the list
list.add(3)
return 0 ;
}
finally {
if(<!UNINITIALIZED_VARIABLE!>list<!> != null) { // Must be an ERROR
}
}
}