mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 08:31:38 +00:00
22 lines
406 B
Kotlin
Vendored
22 lines
406 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
|
|
// WITH_REFLECT
|
|
// 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"
|
|
}
|