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

18 lines
345 B
Kotlin
Vendored

// FULL_JDK
import java.lang.reflect.InvocationTargetException
fun fail(message: String) {
throw AssertionError(message)
}
fun box(): String {
try {
::fail.call("OK")
} catch (e: InvocationTargetException) {
return e.getTargetException().getMessage().toString()
}
return "Fail: no exception was thrown"
}