Incorrect usage of array slices returns stacktrace
LadyCailinBot opened this issue · 1 comments
CMDHELPER-3165 - Reported by Алексей.Положенцев
@arr = array('some', 'thing')[@i + 1..-1]
Stacktrace:
https://pastebin.com/ZCcbDazK
Comment by PseudoKnight
That's not what's happening here. The provided code throws an exception correctly. There's still a bug, though, and it's something to do with a right curly brace.
I found a different error by throwing in a random brace in the cslice.
@arr = array(1, 2)[0..-1}]
This throws an IndexOutOfBoundsException at index 2 (size 1) on line 1238. Various brace placements in that cslice can cause this. This should be fixed too.