JVM IR: Handle nested classes in DelegatedPropertyOptimizer
This commit is contained in:
committed by
Alexander Udalov
parent
da9bff40f0
commit
ca6e430e89
+13
@@ -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
|
||||
}()
|
||||
+7
@@ -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
|
||||
+10
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user