groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C├ędric Champeau <cedric.champ...@gmail.com>
Subject Re: Traits and protected properties
Date Wed, 25 Jan 2017 13:54:34 GMT
Static methods are *copied* to the weaved class. They do not belong to the
trait itself.

2017-01-25 14:53 GMT+01:00 Daniel Sun <realbluesun@hotmail.com>:

> Hi Graeme,
>
>      Here is my test code, which fails:
>
> trait A {
>     public static String m() { return '123' }
> }
>
> A.m()
>
> error messages:
>
> groovy.lang.MissingMethodException: No signature of method: static A.m()
> is
> applicable for argument types: () values: []
> Possible solutions: is(java.lang.Object), any(), dump(),
> any(groovy.lang.Closure), use([Ljava.lang.Object;),
> tap(groovy.lang.Closure)
>
>         at ConsoleScript7.run(ConsoleScript7:5)
>
>
>
> --
> View this message in context: http://groovy.329449.n5.
> nabble.com/Traits-and-protected-properties-tp5738002p5738025.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.
>

Mime
View raw message