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

Eric Milles commented on GROOVY-10500:
--------------------------------------

Static method initialization seems to work.  Also use of static import constant 
appears to have been translated to a fully-qualified name by the time 
{{@NamedVariant}} is processed..

> NamedVariant: non-trivial default value of NamedDelegate property
> -----------------------------------------------------------------
>
>                 Key: GROOVY-10500
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10500
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Minor
>              Labels: named-parameters
>
> Consider the following:
> {code:groovy}
> import groovy.transform.*
> @ToString
> class Pogo {
>     private static V = 42
>     Number n = V
> }
> @NamedVariant(autoDelegate=true)
> void test(Pogo p) {
>     print p
> }
> test([:]) // MissingPropertyException: No such property: V for class: script
> {code}
> Variable expression "V" is transferred from scope of {{Pogo}} to generated 
> method {{test(Map)}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to