blob: e6af9f5e94dcd42e056c48cd3d8f7dec0a02b585 [file] [log] [blame]
import kotlin.reflect.KProperty0
class Sample {
companion object {
val maxValue = 1
}
}
abstract class Checker {
fun check(): String {
return run(
Sample::maxValue,
{ x -> x == 1 }
)
}
abstract fun <T1> run(method: KProperty0<T1>, fn: (T1) -> Boolean): String
}
fun box(): String {
var result = ( object : Checker() {
override fun <T1> run(method: KProperty0<T1>, fn: (T1) -> Boolean): String {
return "OK"
}
} ).check()
return result
}