[Test] Add test for KT-53460

This commit is contained in:
Dmitriy Novozhilov
2023-07-04 09:29:54 +03:00
committed by Space Team
parent 31d046e8cd
commit 5d6328a706
7 changed files with 58 additions and 0 deletions
@@ -0,0 +1,14 @@
// ISSUE: KT-53460
fun test(a: String?, b: String?) {
if (a == null || a == "foo") {
when (b) {
"abc" -> return
}
}
a<!UNSAFE_CALL!>.<!>length // should be an error
if (a == null || a == "bar") { // comparasion to null is not useless
a<!UNSAFE_CALL!>.<!>length
}
}
@@ -0,0 +1,14 @@
// ISSUE: KT-53460
fun test(a: String?, b: String?) {
if (a == null || a == "foo") {
when (b) {
"abc" -> return
}
}
<!DEBUG_INFO_SMARTCAST!>a<!>.length // should be an error
if (<!SENSELESS_COMPARISON!>a == null<!> || a == "bar") { // comparasion to null is not useless
<!DEBUG_INFO_SMARTCAST!>a<!>.length
}
}