Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/call/simpleMemberFunction.kt
Alexander Udalov e079b8f425 Support KCallable.call
#KT-2187 Fixed
2015-07-29 21:36:42 +03:00

17 lines
269 B
Kotlin
Vendored

class A {
fun foo(x: Int, y: Int) = x + y
}
fun box(): String {
val x = (A::foo).call(A(), 42, 239)
if (x != 281) return "Fail: $x"
try {
(A::foo).call()
return "Fail: no exception"
}
catch (e: Exception) {}
return "OK"
}