Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlow/assignment/kt6118.fir.kt
T
2021-05-05 18:20:51 +03:00

17 lines
270 B
Kotlin
Vendored

// KT-6118 Redundant type cast can be not redundant?
fun foo(o: Any) {
if (o is String) {
val s = o <!USELESS_CAST!>as String<!>
s.length
}
}
fun foo1(o: Any) {
if (o is String) {
o.length
val s = o
s.length
}
}