Inspectopedia Help

Range with start greater than endInclusive is empty

Reports ranges that are empty because the start value is greater than the endInclusive value.

Example:

val range = 2..1

The quick-fix changes the .. operator to downTo:

val range = 2 downTo 1

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023