castOrThrow

inline fun <T : Any> Any?.castOrThrow(exception: () -> Throwable): T


inline fun <T : Any> Any?.castOrThrow(): T

See also