JVM IR: Handle nested classes in DelegatedPropertyOptimizer

This commit is contained in:
Steven Schäfer
2020-08-05 15:55:24 +02:00
committed by Alexander Udalov
parent da9bff40f0
commit ca6e430e89
14 changed files with 174 additions and 42 deletions
@@ -0,0 +1,13 @@
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.reflect.KProperty
operator fun Int.provideDelegate(thiz: Any?, property: KProperty<*>): String = property.name
inline operator fun String.getValue(thiz: Any?, property: KProperty<*>): String = property.name
fun box(): String = with(42) {
val O by this
O
} + {
val K by ""
K
}()
@@ -0,0 +1,7 @@
import kotlin.reflect.KProperty
inline operator fun String.getValue(thiz: Any?, property: KProperty<*>): String = property.name
fun box(): String = object {
val OK by ""
}.OK
@@ -0,0 +1,10 @@
import kotlin.reflect.KProperty
inline operator fun String.getValue(thiz: Any?, property: KProperty<*>): String = property.name
fun box(): String {
class Local {
val OK by ""
}
return Local().OK
}