Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/castchecks/castInTryWithoutCatch.fir.kt
T

18 lines
387 B
Kotlin
Vendored

fun castInTry(s: Any) {
try {
s as String // Potential cast exception
} finally {
s.length // Shouldn't be resolved
}
s.length // Shouldn't be resolved
}
fun castInTryAndFinally(s: Any) {
try {
s as String // Potential cast exception
} finally {
s as String // Potential cast exception
}
s.length // Should be smartcast
}