[ 
https://issues.apache.org/jira/browse/GROOVY-8854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-8854.
-----------------------------

> 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
>            Assignee: Eric Milles
>            Priority: Major
>              Labels: trait, traits
>             Fix For: 5.0.0-alpha-2
>
>
> 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.20.10#820010)

Reply via email to