Daniil Ovchinnikov created GROOVY-9327:
------------------------------------------
Summary: @CompileStatic is not propagated to anonymous class
Key: GROOVY-9327
URL: https://issues.apache.org/jira/browse/GROOVY-9327
Project: Groovy
Issue Type: Bug
Components: Static compilation, Static Type Checker
Affects Versions: 2.5.8
Reporter: Daniil Ovchinnikov
{code:java}
@groovy.transform.CompileStatic
def method() {
new Runnable() {
@Override
void run() {
foo // invalid reference
}
}
} {code}
Expected: Error:(6, 13) Groovyc: [Static type checking] - The variable [foo] is
undeclared.
Actual: no error is reported.
Note that annotating {{run}} method works properly, i.e. the error is reported.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)