You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/01/27 00:45:01 UTC
[jira] [Closed] (GROOVY-9327) @CompileStatic is not propagated to
anonymous class
[ https://issues.apache.org/jira/browse/GROOVY-9327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-9327.
-----------------------------
> @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
>
> 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.3.4#803005)