blob: 1453eed0595e5bd2afecfed7e89410462a97ce44 [file] [log] [blame]
// 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