23698f93e0
Inline lambda could capture reified parameter of containing inline function ('a' function)
when it is inlined in another one.
If it's inlined in any anonymous object we should track it and
add reification marker to such anonymous object instance creation
to rewrite it on inlining bytecode of 'a' function.
#KT-15997 Fixed
27 lines
456 B
Kotlin
Vendored
27 lines
456 B
Kotlin
Vendored
// FILE: 1.kt
|
|
// FULL_JDK
|
|
// WITH_REFLECT
|
|
package test
|
|
|
|
import kotlin.properties.Delegates
|
|
import kotlin.properties.ReadWriteProperty
|
|
|
|
var result = "fail"
|
|
|
|
inline fun <reified T : Any> crashMe(): ReadWriteProperty<Any?, Unit> {
|
|
return Delegates.observable(Unit, { a, b, c -> result = T::class.java.simpleName })
|
|
}
|
|
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
|
|
class OK {
|
|
var value by crashMe<OK>()
|
|
}
|
|
|
|
fun box(): String {
|
|
OK().value = Unit
|
|
return result
|
|
} |