There should be a ! at the beginning of the if. The lack of it makes the expression parse when it (mostly) shouldn't and not parse when it should. I don't think this needs any more proof, but anyway, as an example, sorted 1 and 2 doesn't work without adding the ! (aka currently).
It can't however be simply fixed by adding the ! since the init method's type checking seems to be more broken (or variables are), refer to this script which works without the fix and doesn't work after it:
on load:
set {_x::*} to 6, 3, 9
send "%sorted {_x::*}%"
The error after adding the !:
[14:38:34 ERROR]: List of type class java.lang.Object does not support sorting. (test.sk, line 16: send "%sorted {_x::*}%"')
The super type of the items in the list variables seems to be determined to be an Object (instead of something like an Integer, Long or Number)
We're probably better off removing the parse-time check and failing silently when the list in question isn't comparable.
You're actually trying to send a message to nobody on a load event
Lol @Matocolotoe, this doesn't affect the issue, but nice catch thanks 馃帀
I know it's useless here, but still wanted to share this x)
Most helpful comment
I know it's useless here, but still wanted to share this x)