c7435ba760
We are going to deprecate `WITH_RUNTIME` directive. The main reason behind this change is that `WITH_STDLIB` directive better describes its meaning, specifically it will add kotlin stdlib to test's classpath.
29 lines
586 B
Kotlin
Vendored
29 lines
586 B
Kotlin
Vendored
// WITH_STDLIB
|
|
|
|
// FILE: main.kt
|
|
import kotlin.reflect.KFunction1
|
|
|
|
class Sample {
|
|
inner class SS
|
|
}
|
|
|
|
abstract class Checker {
|
|
fun check(): String {
|
|
return run(
|
|
Sample::SS,
|
|
{ x, y -> x == Any() && y == Any() }
|
|
)
|
|
}
|
|
abstract fun <T1, T2> run(method: KFunction1<T1, T2>, fn: (T1, T2) -> Boolean): String
|
|
}
|
|
|
|
fun box(): String {
|
|
var result = ( object : Checker() {
|
|
override fun <T1, T2> run(method: KFunction1<T1, T2>, fn: (T1, T2) -> Boolean): String {
|
|
return "OK"
|
|
}
|
|
} ).check()
|
|
|
|
return result
|
|
}
|