groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wagenleitner (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-8205) Static type checking failure for enums
Date Sat, 26 Aug 2017 19:37:01 GMT

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

John Wagenleitner resolved GROOVY-8205.
---------------------------------------
       Resolution: Fixed
         Assignee: John Wagenleitner
    Fix Version/s: 2.5.0-beta-2

> Static type checking failure for enums
> --------------------------------------
>
>                 Key: GROOVY-8205
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8205
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.4.10
>         Environment: Windows 7, JDK 1.8.0_66
>            Reporter: Iurii
>            Assignee: John Wagenleitner
>             Fix For: 2.5.0-beta-2
>
>
> Declare enum:
> {code}
> public enum Functions {
>     A, B, C
> }
> {code}
> Create test class, add the following test and try to compile:
> {code}
>     @Test
>     @CompileStatic
>     void testEachForEnum() {
>         Functions.values().each { println it.name() }
>     }
> {code}
> Result: Groovyc: [Static type checking] - Cannot find matching method java.lang.Object#name().
Please check if the declared type is right and if the method exists.
> Expected: code should compile without errors



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message