2611c7de7e
The problem is that now that the local delegated property metadata is in the $$delegatedProperties array of the containing class, the access to it from code calling an inline function with a local delegated property is illegal. Currently it seems to be a lot of work to support this rather rare case properly (see the comment in ExpressionCodegen.getVariableMetadataValue) so we postpone it and return the old behavior of using the anonymous KProperty subclass for metadata
24 lines
306 B
Kotlin
Vendored
24 lines
306 B
Kotlin
Vendored
// FILE: 1.kt
|
|
package test
|
|
|
|
import kotlin.reflect.KProperty
|
|
|
|
class Delegate {
|
|
operator fun getValue(t: Any?, p: KProperty<*>): String = "OK"
|
|
}
|
|
|
|
inline fun test(): String {
|
|
val b by Delegate()
|
|
|
|
return run {
|
|
b
|
|
}
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
return test()
|
|
}
|