mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 00:21:32 +00:00
18 lines
340 B
Kotlin
Vendored
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"
|
|
}
|