[Test] Add test for KT-62137

This commit is contained in:
Dmitriy Novozhilov
2023-11-06 10:16:22 +02:00
committed by Space Team
parent fd1c885c5b
commit c5d1c4e816
7 changed files with 66 additions and 0 deletions
@@ -0,0 +1,18 @@
// 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
}
}
@@ -0,0 +1,18 @@
// ISSUE: KT-62137
class PersonDto (
val name: String
)
fun test() {
val name: String? = null
val person: PersonDto? = null
if (!name.isNullOrEmpty()) {
<!DEBUG_INFO_SMARTCAST!>name<!>.length // Smart cast work
}
if (!person?.name.isNullOrEmpty()) {
person<!UNSAFE_CALL!>.<!>name // Smart cast doesn't work
}
}