Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.9, 2.2.1
-
None
Description
In the following script, the empty range is apparently treated as a slice of size 1:
testMethod() @groovy.transform.CompileStatic def testMethod() { def list = ["1", "2", "3", "4"] assert list[0..<0] == [] println list }
If you remove the annotation, the assertion passes.
Attachments
Issue Links
- is related to
-
GROOVY-6493 size() and iterator() not correct for an empty IntRange
- Closed