So, I expect there's something about the syntax of @Grab (or @?) that is allowing for the possibility of more text related to it such that the method 'println' is ambiguous but 'def' clearly terminates the @Grab and starts a new element. A minor thing, but confusing.

Jochen Theodorou
added a comment - 14/Dec/11 14:20 the problem is more that you cannot yet annotate a method call. We intend to change this in the long term, but we have to diverge from Java on this, since Java annotations don't allow for that at all.
Of course the error message is better in the later case, still it is not accepted by the grammar in both cases.