Fix temporary variable elimination in JS BE
Don't eliminate temporary variable when between its usage and its definition there's assignment to a non-local variable. Fix KT-17540
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
private var _value: String = "OK"
|
||||
|
||||
private inline fun String.myAlso(f: (String) -> Unit): String {
|
||||
f(this)
|
||||
return this
|
||||
}
|
||||
|
||||
fun overrideValueAndReturnOld(newValue: String) = _value.myAlso { _value = newValue }
|
||||
|
||||
fun box() = overrideValueAndReturnOld("fail")
|
||||
Reference in New Issue
Block a user