[Test] Add test for KT-62137
This commit is contained in:
committed by
Space Team
parent
fd1c885c5b
commit
c5d1c4e816
Vendored
+18
@@ -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
|
||||
}
|
||||
}
|
||||
+18
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user