Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
1.0-JSR-4
-
None
-
None
Description
Let's say I have a method that receives a string that contains an integer (0..9). If I use that parameter as part of a range, Groovy considers it a character which causes some really unexpected effects. For example:
str = "5"
// ...
lastNumber = str;
myRange = 0..lastNumber
myRange.each {
print it
}
I would expect it to print: 012345
Instead it takes the character value of 5 and prints: 0123456789101112 ... 515253
Is this what is really wanted or should this be considered a bug? At least it makes it pretty easy to make mistakes.