Askar
Askar

Reputation: 5854

IntelliJ highlights as error a working code in Griffon

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

Upvotes: 2

Views: 176

Answers (2)

Max Medvedev
Max Medvedev

Reputation: 303

Fixed. IntelliJ IDEA 12.1.2 will support it

Upvotes: 1

Andres Almiray
Andres Almiray

Reputation: 3281

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.

Upvotes: 2

Related Questions