CommandHelper

CommandHelper

46.5k Downloads

Stacktrace with improper type casting.

LadyCailinBot opened this issue ยท 6 comments

commented

CMDHELPER-3066 - Reported by Lildirt

When casting an ivar to an incorrect type, a stacktrace is generated.

An example of this exception can be found at http://paste.thezomg.com/17448/76451614/

commented

Comment by Pieter12345

Can you post the code that causes this stacktrace?

commented

Comment by Lildirt

@Pieter12345 iirc it's something like "array @ivar = 'someValue';" but honestly as much as I hate to say it I don't have the snip that actually caused it.

commented

Comment by PseudoKnight

It actually happens if you do something like this "array array() = 'someValue';"

commented

Comment by Pieter12345

The keyword 'array' tells something about the variable after it (for example "array @arr = array()". If you put something other than a variable (@var) next to it, it'll still attempt to set the data type of it, as if it was a variable (IVariable). I guess somewhere in the code, this isn't handled properly. It should throw a compile error.

commented

Comment by Pieter12345

Looking what the optimizer does makes this way more understandible.

array @arr = array() ---> optimizer ---> assign(array, @arr, array())
array array() = 'value' ---> optimizer ---> assign(array, array(), 'value') <--- The second argument isn't an IVariable.

commented

Comment by Pieter12345

Fixed in: #340