mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
The number of initializations of the `value` field before the live range begins does not really matter so long as we insert a write of a default value to the local if there were none.
16 lines
266 B
Kotlin
Vendored
16 lines
266 B
Kotlin
Vendored
inline fun <reified T> foo(default: T): T {
|
|
val t: T
|
|
run {
|
|
t = default
|
|
}
|
|
return t
|
|
}
|
|
|
|
fun test() {
|
|
foo(0.0f)
|
|
}
|
|
|
|
// two in foo and two in test
|
|
// 4 ASTORE 2
|
|
// 1 LOCALVARIABLE t Ljava/lang/Object;
|
|
// 1 LOCALVARIABLE t\$iv Ljava/lang/Object; |