Files
kotlin-fork/compiler/testData/codegen/script/localDelegatedPropertyInLambda.kts
T
Ilya Chernikov 5824b9c59c K2 Scripting: add Fir script codegen tests
27 failing tests are muted
2023-07-05 19:46:03 +00:00

19 lines
377 B
Kotlin
Vendored

// IGNORE_BACKEND_K2: JVM_IR
// WITH_REFLECT
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): String =
if (p.returnType.toString() == "kotlin.String") "OK" else "Fail: ${p.returnType}"
}
fun f(lambda: () -> String): String = lambda()
val x = f {
val prop: String by Delegate()
prop
}
// expected: x: OK