Question

Below is a snippet from a working code taken from the Groovy in Action book. As you see below, IntelliJ sees it as error.

Why?

See picture below:

enter image description here

Was it helpful?

Solution

I don't think IDEA is to blame here. Griffon is exploiting a trick that Groovy brings to the table: using closures as annotation values. However @PropertyListener goes a bit further by allowing closure properties to be used too, but in order to do it converts invalid code (a property name cannot be used as an annotation value) into valid code (changes the annotation value into an empty String).

There is no way IDEA can be aware that the Griffon compiler is using this trick, hence the red squiggles. Regardless of this, don't be alarmed, the Griffon compiler will do the right thing.

OTHER TIPS

Fixed. IntelliJ IDEA 12.1.2 will support it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top