Put default value to vars iff they are not boxed

#KT-24672 Fixed
This commit is contained in:
Ilmir Usmanov
2019-01-14 15:47:18 +03:00
parent 62322dec5c
commit 76e9b574cd
12 changed files with 235 additions and 11 deletions
@@ -0,0 +1,18 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> foo(default: T): T {
var t: T
run {
t = default
}
return t
}
fun test() {
foo(0.0f)
}
// two in foo and two in test
// 2 ASTORE 2
// 1 LOCALVARIABLE t\$iv Lkotlin/jvm/internal/Ref\$ObjectRef; L3 L13 2