groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulk-asert <...@git.apache.org>
Subject [GitHub] groovy pull request #625: GROOVY-8369: Statically compiled property access o...
Date Wed, 01 Nov 2017 07:19:59 GMT
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.


---

Mime
View raw message