Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falseNegativeSmartcasts.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

18 lines
386 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_VALUE -VARIABLE_WITH_REDUNDANT_INITIALIZER
// Related issue: KT-28370
fun test1(s1: String?) {
var s: String? = null
s = ""
try {
s = ""
requireNotNull(s1)
}
catch (e: Exception) {
return
}
finally {
<!DEBUG_INFO_SMARTCAST!>s<!>.length
}
<!DEBUG_INFO_SMARTCAST!>s<!>.length
}