21bc2887d2
Omit Unit return type Refactor handling of Unit type: extract separate object UnitType
13 lines
396 B
Kotlin
13 lines
396 B
Kotlin
package demo
|
|
open class Test() {
|
|
class object {
|
|
open fun subListRangeCheck(fromIndex : Int, toIndex : Int, size : Int) {
|
|
if (fromIndex < 0)
|
|
throw IndexOutOfBoundsException("fromIndex = " + fromIndex)
|
|
if (toIndex > size)
|
|
throw IndexOutOfBoundsException("toIndex = " + toIndex)
|
|
if (fromIndex > toIndex)
|
|
throw IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")")
|
|
}
|
|
}
|
|
} |