Files
kotlin-fork/compiler/testData/codegen/box/smartCasts/avoidSmartCastToDerivedForPrivate.kt
T
2022-06-01 16:02:30 +00:00

17 lines
262 B
Kotlin
Vendored

open class Base {
fun foo(): String {
return when (this) {
is Derived -> baz()
else -> "fail 1"
}
}
private fun baz(): String = "OK"
}
class Derived : Base()
fun box(): String {
return Derived().foo()
}