Control flow analysis: nested finally blocks now appear in correct order in CFG #KT-4764 Fixed
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
fun use(arg: String?) = arg
|
||||
|
||||
fun sample(): String? {
|
||||
try {
|
||||
if (false) {
|
||||
return "fail"
|
||||
} else {
|
||||
if (false) {
|
||||
if (false) {
|
||||
var foo: String? = null
|
||||
try {
|
||||
foo = "test"
|
||||
} catch (e: Exception) {
|
||||
return "fail"
|
||||
} finally {
|
||||
use(foo) // 'foo' is initialized here
|
||||
}
|
||||
}
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
} finally {}
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user