Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.5.12, 2.5.14
-
None
-
None
Description
Use of long values when describing an array range results in a reserved result when it should not.
For example, the following is true in 2.5.11 and false starting in 2.5.12:
[1L, 2L, 3L, 4L, 5L, 6L][(2L .. -2L)] == [3L, 4L, 5L]
The following however is true in all versions of 2.5:
[1L, 2L, 3L, 4L, 5L, 6L][(2 .. -2)] == [3L, 4L, 5L]
I believe this bug was introduced in the fix for https://issues.apache.org/jira/browse/GROOVY-8966. The NumberRange produced reverses the from and to resulting in the reversed sequence.