Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/contracts/complexConditionWithSafeCall.fir.kt
T
2023-11-06 15:24:39 +00:00

19 lines
314 B
Kotlin
Vendored

// ISSUE: KT-62137
class PersonDto (
val name: String
)
fun test() {
val name: String? = null
val person: PersonDto? = null
if (!name.isNullOrEmpty()) {
name.length // Smart cast work
}
if (!person?.name.isNullOrEmpty()) {
person.name // Smart cast doesn't work
}
}