[ 
https://issues.apache.org/jira/browse/GROOVY-9327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-9327:
--------------------------------
    Fix Version/s: 2.5.16

> @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
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 3.0.0-rc-3, 2.5.16
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {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.20.1#820001)

Reply via email to