holgerbrandl
04/04/2018, 2:49 PMkotlin.Throwable
isn’t extending java.lang.Throwable
. Also the docs are not too helpful: https://kotlinlang.org/docs/reference/exceptions.html states that
All exception classes in Kotlin are descendants of the class Throwablebut I could not find any example in the stdlib. E.g. see kotlin.KotlinNullPointerException as a counter-example.
ilya.gorbunov
04/04/2018, 3:02 PMilya.gorbunov
04/04/2018, 3:02 PMkotlin.Throwable
doesn't have its own runtime representation in JVM and is mapped onto java.lang.Throwable
in runtimeholgerbrandl
04/04/2018, 3:04 PMilya.gorbunov
04/04/2018, 3:06 PMholgerbrandl
04/04/2018, 3:07 PMilya.gorbunov
04/04/2018, 3:09 PMkotlin.Exception
, kotlin.Error
, kotlin.RuntimeException
etc. On JVM these are typealiases to JDK exception classes.