Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt
T
2019-11-19 11:00:09 +03:00

22 lines
336 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: F.A, p: KProperty<*>): Int = 1
}
class F {
val A.prop: Int by Delegate()
class A {
}
fun foo(): Int {
return A().prop
}
}
fun box(): String {
return if(F().foo() == 1) "OK" else "fail"
}