[Test] Add a test covering changes in the evaluation semantics of safe call with smart cast in K2
Addition to other safe call tests that are already present in tests. ^KT-41034
This commit is contained in:
committed by
Space Team
parent
12b3fbd39a
commit
aef6787e87
@@ -0,0 +1,15 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
class C {
|
||||
var x: Int = 0
|
||||
}
|
||||
|
||||
fun test(с: C?, a: Any) {
|
||||
с?.x = if (a is String) 0 else throw Exception();
|
||||
<!DEBUG_INFO_SMARTCAST!>a<!>.<!DEPRECATION!>toUpperCase<!>()
|
||||
}
|
||||
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
test(null, 1)
|
||||
}
|
||||
Reference in New Issue
Block a user