groovy-notifications mailing list archives

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

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

ASF GitHub Bot commented on GROOVY-8205:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/592


> 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
>
> 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