castOrThrow

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

Casts Any to a type T or throw a ClassCastException.

Chained function call alternative to this as T.

Return

The cast value of type T.

See also

Throws

if the cast fails.