I looked into source code and looks like array datatypes are not parsed correctly (int interpreted like int and later check for expression parameters doesn't like to have primitive and none primitive types mixed together or something like this)
Anyway, in case somebody would have similar problem, one way to avoid it -
is to wrap return value with $w and assign it to Object obj and use obj instead of $_. Not sure if it will work for all cases but at least should prevent compilation exception.
cm.insertAfter("Object obj = (($w)$_); if (obj == null) ... ;");
Thank you for your bug report.
I have fixed it. Please download the latest snapshot
from the CVS HEAD.