Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/call/exceptionHappened.kt
2016-01-22 05:54:38 +03:00

18 lines
340 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().message.toString()
}
return "Fail: no exception was thrown"
}