Put default value to vars iff they are not boxed
#KT-24672 Fixed
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user