CommandHelper

CommandHelper

46.5k Downloads

Fun times with @array[..1] and other silliness.

LadyCailinBot opened this issue ยท 1 comments

commented

CMDHELPER-2892 - Reported by EntityReborn

We have a test that fails, where array(1,2,3,4)[..1] returns 2 instead of array(1,2).
Also, msg([..1]) causes a stacktrace.

I've been debugging this in interpreter-standalone mode, and it looks like [..1] notation doesn't trigger a SLICE token. Breakpoints at line 1055 and 1058 of MethodScriptCompiler are hit, instead of 1198. Line 444 isn't getting hit either, which where SLICE is added to the token list. It would appear to me that line 1074 would technically take [..1] and autoconcat it, making it [1], which would reflect what the result is.

Interestingly enough, the variables declared at lines 980, 981 and 990 are said to be unused by my IDE.

commented

Comment by LadyCailin

Fixed. In latest builds.