[ https://issues.apache.org/jira/browse/GROOVY-8369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16233735#comment-16233735 ]
ASF GitHub Bot commented on GROOVY-8369: ---------------------------------------- Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/625#discussion_r148195160 --- Diff: src/test/org/codehaus/groovy/classgen/asm/sc/FieldsAndPropertiesStaticCompileTest.groovy --- @@ -696,4 +696,21 @@ import org.codehaus.groovy.transform.sc.ListOfExpressionsExpression assert astTrees['A$_closure1'][1].contains('INVOKESTATIC A.pfaccess$02 (LA;Ljava/lang/String;)Ljava/lang/String;') } } + + //GROOVY-8369 + void testPropertyAccessOnEnumClass() { + try { + assertScript ''' + enum Foo {} + + def test() { + println Foo.getModifiers() // => 16401 // ENUM | FINAL | PUBLIC (see GROOVY_8360 wrt STATIC) + println Foo.modifiers // java.lang.NoSuchFieldError: modifiers + } + test() + ''' + } finally { + //println astTrees + } + } --- End diff -- Actually, I'll merge now and tweak the test as per above. > Enum property access not working with @CompileStatic > ---------------------------------------------------- > > Key: GROOVY-8369 > URL: https://issues.apache.org/jira/browse/GROOVY-8369 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Affects Versions: 2.4.12 > Reporter: Paul King > Assignee: Shil Sinha > Priority: Major > > {code} > import groovy.transform.CompileStatic > enum Foo { } > @CompileStatic > def test() { > println Foo.getModifiers() // => 16401 // ENUM | FINAL | PUBLIC (see > GROOVY_8360 wrt STATIC) > println Foo.modifiers // java.lang.NoSuchFieldError: modifiers > } > test() > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)