upperBound

inline fun <T> upperBound(): T

Returns the upper bound, cast to T.

Empty, unbounded and NULL all mean there is no value to give back, and they are not distinguished here - declare T nullable to receive null for any of the three, or interrogate isEmpty, isUpperInfinite and isUpperNull to tell them apart.

Return

The upper bound.

Type Parameters

T

The expected bound type.

Throws

CONVERSION_ERROR if there is no bound and T is not nullable, or the bound is not a T.