You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2019/11/01 07:50:00 UTC

[jira] [Commented] (GROOVY-8053) Groovyc: anonymous class in static method cannot access its fields without "this"

    [ https://issues.apache.org/jira/browse/GROOVY-8053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16964690#comment-16964690 ] 

Daniel Sun commented on GROOVY-8053:
------------------------------------

{quote}meta version for 3.x for scheduling work (with new grammar) - don't leave as fix version
{quote}
I will set the fix version to the latest released version

> Groovyc: anonymous class in static method cannot access its fields without "this"
> ---------------------------------------------------------------------------------
>
>                 Key: GROOVY-8053
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8053
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.8
>         Environment: JAVA_VERSION="1.8.0_111"
> OS_NAME="Windows"
> OS_VERSION="5.2"
> OS_ARCH="amd64"
>            Reporter: Daniel Huss
>            Priority: Minor
>             Fix For: 2.5.8, 3.0.0-rc-1
>
>
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic // also happens without it
> final class TestCase {
>     static thisShouldCompile() {
>         Object o = new Object() {
>             int inaccessible
>             @Override
>             int hashCode() {
>                 inaccessible++ // succeeds when qualified with "this"
>                 return super.hashCode()
>             }
>         }
>     }
>     static void main( String... args ) {
>         thisShouldCompile()
>         System.out.println( "Success" )
>     }
> }
> {code}
> Could be related to GROOVY-7020



--
This message was sent by Atlassian Jira
(v8.3.4#803005)