Back to Intellij Community

EmptyRange

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/EmptyRange.html

2025.3-rc-2223 B
Original Source

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