Back to Intellij Community

GroovyLoopStatementThatDoesntLoop

plugins/groovy/groovy-psi/resources/inspectionDescriptions/GroovyLoopStatementThatDoesntLoop.html

2025.3-rc-2241 B
Original Source

Reports for or while statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.

Example:

for (int i in 0..<10) {
    return
  }