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

16 lines
300 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
package foo
import kotlin.reflect.KProperty
inline fun <T> run(f: () -> T) = f()
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
fun box(): String {
val prop: Int by Delegate()
return run { if (prop == 1) "OK" else "fail" }
}