I would be tempted to define compareTo on numberTy...
# codereview
d
I would be tempted to define compareTo on numberType so that the function could be rewritten as
fun containsCompletely(other: OpenRange<NumberType>): Boolean = this.startInclusive <= other.startInclusive && this.endInclusive >= other.endInclusive