groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gyula Varga (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-6862) Traits dont allow $ in identifiers where normal classes do
Date Tue, 04 Aug 2015 15:03:04 GMT

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

Gyula Varga commented on GROOVY-6862:
-------------------------------------

Any news on this one? 
Since this is really a blocker for us, we will have to change many method names if this is
not getting fixed. (We are using the $ sign for reflection magic)

> Traits dont allow $ in identifiers where normal classes do
> ----------------------------------------------------------
>
>                 Key: GROOVY-6862
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6862
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.3
>            Reporter: OC
>              Labels: traits
>
> looks like traits are stricter than the "normal" groovy when an identifier happens to
contain the dollar sign:
> {code}
> 252 /tmp> <q.groovy
> trait Test {
>  static foo_ok() { println 'trait non-$ OK' }
>  static foo$oops() { println 'trait $ OK' }
> }
> class Foo implements Test {
>  static foo$ok() { println 'class $ OK' }
> }
> Foo.foo$ok()
> Foo.foo_ok()
> Foo.foo$oops()
> 253 /tmp> groovy q
> class $ OK
> trait non-$ OK
> Caught: groovy.lang.MissingMethodException: No signature of method: static Foo.foo$oops()
is applicable for argument types: () values: []
> Possible solutions: foo$ok(), foo_ok()
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message