Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.fir.kt
T
Pavel Kirpichenkov 15d744c3da [NI] Continue resolution after unstable smart cast on receiver
The old inference cosideres candidates with unstable smartcast on
receiver unsuccessful, therefore another one may be selected.
KT-36264
2020-02-13 18:02:38 +03:00

28 lines
392 B
Kotlin
Vendored

interface Base {
val parent: Base
}
class Derived : Base {
override val parent: Base
get() = TODO()
}
fun test(d: Derived) {
when {
d.parent is Derived -> d.parent.parent
}
}
fun Any?.take() {}
class Something {
var prop: String? = null
fun String.take() {}
fun test() {
if (prop is String) {
prop.take()
}
}
}