Consider the following:
import groovy.transform.*
import static org.codehaus.groovy.control.CompilePhase.*
import static org.codehaus.groovy.transform.stc.StaticTypesMarker.*
@CompileStatic
class C {
void m() {
def that = this;
{ ->
@ASTTest(phase=INSTRUCTION_SELECTION, value={
def type = node.getNodeMetaData(INFERRED_TYPE)
assert type.name == 'C'
})
def ref = getThisObject()
assert ref == that
}()
}
}
new C().m()
The @ASTTest is marked with an error indicating that a closure literal should be supplied for the "value" member. However one is given, so the error is unexpected. Also, syntax highlighting seems to be missing for the "value" name and value.

Consider the following:
The
@ASTTestis marked with an error indicating that a closure literal should be supplied for the "value" member. However one is given, so the error is unexpected. Also, syntax highlighting seems to be missing for the "value" name and value.