[
https://issues.apache.org/jira/browse/GROOVY-8854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-8854:
--------------------------------
Labels: trait traits (was: )
> MissingMethodException when a public method on a trait calls a static private
> one in a class hierarchy
> ------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-8854
> URL: https://issues.apache.org/jira/browse/GROOVY-8854
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.15, 3.0.0-alpha-3, 2.5.3
> Reporter: Iván López
> Priority: Major
> Labels: trait, traits
>
> The following code fails at runtime:
> {code:java}
> trait Validateable {
> boolean validate() {
> return foo()
> }
> private static boolean foo() {
> return false
> }
> }
> class DomainObject implements Validateable {
> String name
> }
> class Child extends DomainObject {
> }
> def child = new Child(name: 'name')
> child.validate()
> {code}
> With this error:
> {code}
> groovy.lang.MissingMethodException: No signature of method: Child.foo() is
> applicable for argument types: () values: []
> {code}
> Keep in mind that the Trait method is _framework-code_ (in this case from
> Grails) and {{DomainObject}} and {{Child}} classes are _user-code_.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)