Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt32358_1.kt
T
Pavel Kirpichenkov 3fcf3d6fea Add regression tests
KT-32358
2020-01-15 14:39:40 +03:00

18 lines
350 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
class MyChild {
val nullableString: String? = null
val notNull = ""
}
class MyParent {
val child: MyChild? = MyChild()
}
fun myFun() {
val myParent = MyParent()
myParent.child?.nullableString ?: run { return }
<!DEBUG_INFO_SMARTCAST!>myParent.child<!>.notNull // <- No smart cast in plugin
}