[Test] Add test for KT-53460
This commit is contained in:
committed by
Space Team
parent
31d046e8cd
commit
5d6328a706
Vendored
+14
@@ -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
|
||||
}
|
||||
}
|
||||
+14
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user