Files
kotlin/compiler/testData/codegen/bytecodeText/checkcast/kt14811.kt
Dmitry Petrov a087ea559f Eliminate redundant CHECKCAST instructions
CHECKCAST is redundant if the corresponding static type exactly matches the target type.
CHECKCAST instructions to-be-reified should not be eliminated.

KT-14811 Unnecessary checkcast generated in parameterized functions
KT-14963 unnecessary checkcast java/lang/Object
2017-03-13 09:04:31 +03:00

12 lines
187 B
Kotlin
Vendored

interface WorldObject {
val name: String
}
fun testB(worldObj: WorldObject) {
val y = worldObj.let {
println("object name: ${it.name}")
it
}
}
// 0 CHECKCAST