7e2f15f532
The logic should clear back aliases as well. To ensure all back aliases don't lose any information, statements on the original variable are copied over to its aliases.
46 lines
718 B
Kotlin
Vendored
46 lines
718 B
Kotlin
Vendored
// KT-15792 and related
|
|
|
|
fun foo() {
|
|
var x: String? = ""
|
|
val y = x
|
|
x = null
|
|
if (y != null) {
|
|
x<!UNSAFE_CALL!>.<!>hashCode()
|
|
}
|
|
}
|
|
|
|
fun foo2() {
|
|
var x: String? = ""
|
|
val y = x
|
|
if (y != null) {
|
|
x.hashCode()
|
|
}
|
|
}
|
|
|
|
fun bar(s: String?) {
|
|
var ss = s
|
|
val hashCode = ss?.hashCode()
|
|
ss = null
|
|
if (hashCode != null) {
|
|
ss<!UNSAFE_CALL!>.<!>hashCode()
|
|
}
|
|
}
|
|
|
|
fun bar2(s: String?) {
|
|
var ss = s
|
|
val hashCode = ss?.hashCode()
|
|
if (hashCode != null) {
|
|
ss.hashCode()
|
|
}
|
|
}
|
|
|
|
class Some(var s: String?)
|
|
|
|
fun baz(arg: Some?) {
|
|
val ss = arg?.s
|
|
if (ss != null) {
|
|
arg.hashCode()
|
|
arg.s<!UNSAFE_CALL!>.<!>hashCode()
|
|
}
|
|
}
|