Delete clean reference instructions on dereferencing captured variables
Codegen generates clean instructions for ref values (captured vars) on block exit so we should delete them on dereferencing captured values. #KT-17200 FIXED
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
inline fun inlineCall(action: () -> Unit) {
|
||||
action()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
var width = 1
|
||||
inlineCall {
|
||||
width += width
|
||||
}
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
var width = 1L
|
||||
val newValue = 1;
|
||||
val newValue2 = "123";
|
||||
val newValue3 = 2.0;
|
||||
inlineCall {
|
||||
width += width
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test()
|
||||
test2()
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user