<Why Kotlin needs downTo instead of just allowing ...
# forum
r
Why Kotlin needs downTo instead of just allowing a negative step? Hey folks, I have a simple question but I can’t figure out for long while since I learned Kotlin… Why does Kotlin needs a separate downTo infix instead of allowing the step to accept negative numbers? e.g. What is the counter example that a clause like 10 rangeTo 1 step -1 confuses the compiler? 1 post - 1 participant Read full topic