You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Iván López (JIRA)" <ji...@apache.org> on 2018/10/23 07:18:00 UTC
[jira] [Updated] (GROOVY-8854) MissingMethodException when a public
method on a trait calls a static private one in a class hierarchy
[ https://issues.apache.org/jira/browse/GROOVY-8854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Iván López updated GROOVY-8854:
-------------------------------
Affects Version/s: 3.0.0-alpha-3
> 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
>
> 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
(v7.6.3#76005)