groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samotsvet Dmitrii (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8898) Annotation value cannot take inline constant from enum.
Date Tue, 04 Dec 2018 09:43:00 GMT

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

Samotsvet Dmitrii commented on GROOVY-8898:
-------------------------------------------

Same as GROOVY-3278

> Annotation value cannot take inline constant from enum.
> -------------------------------------------------------
>
>                 Key: GROOVY-8898
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8898
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.4
>         Environment:  - Windows 10 
>  - IntelliJ Idea 2018
>            Reporter: Samotsvet Dmitrii
>            Priority: Major
>
> I've had enum MyProfiles
>  
> {code:java}
> public enum MyProfiles {
>     /**some code is here
>     */
>     public final static String FIRST_PROFILE = "FIRST";
>     public final static String SECOND_PROFILE = "SECOND";
> }
> {code}
> And I've used next code in Spock test
>  
>  
> {code:java}
> @ActiveProfiles([FIRST_PROFILE ,SECOND_PROFILE ])
> {code}
>  
> So, i've got next error at compile time
> Error: Groovyc: Expected 'MyProfiles.FIRST_PROFILE' to be an inline constant of type
java.lang.String not a property expression in @org.springframework.test.context.ActiveProfiles
> Error: Groovyc:Attribute 'value' should have type java.lang.String but found type java.lang.Object
in @org.springframework.test.context.ActiveProfiles
>  
> But it works if i use 'class' instead of 'enum'



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message