Re: Traits and protected properties

2017-01-25 Thread Jim Northrop
the implementation of traits based on the enhanced >> interfaces? then traits can have its own static methods and method >> implementation(based on the default method). >> >> Cheers, >> Daniel.Sun >> >> >> >> -- >> View this message in context: >> http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p5738028.html >> Sent from the Groovy Dev mailing list archive at Nabble.com. >

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
va 8+ in Groovy 3+ releases? > > Cheers, > Daniel.Sun > > > > -- > View this message in context: http://groovy.329449.n5. > nabble.com/Traits-and-protected-properties-tp5738002p5738031.html > Sent from the Groovy Dev mailing list archive at Nabble.com. >

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
Hi Cédric, As far as I remember, Groovy 3+ will require Java 8. So maybe we could upgrade the default version of class file to Java 8+ in Groovy 3+ releases? Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Traits-and-protected-properties

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
methods in the interfaces, > how about refining the implementation of traits based on the enhanced > interfaces? then traits can have its own static methods and method > implementation(based on the default method). > > Cheers, > Daniel.Sun > > > > -- > View this messa

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
en traits can have its own static methods and method implementation(based on the default method). Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p5738028.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
g.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. >> > >

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
> 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. >

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
ang.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

Re: Traits and protected properties

2017-01-25 Thread Graeme Rocher
methods too... So maybe we should generate bytecode > for default methods and static methods of interface as Java 8 do. > > Cheers, > Daniel.Sun > > > > -- > View this message in context: > http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
: http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p5738022.html Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
a protected property just cannot work > Could you tell me why trait does not support protected property? > > Thanks, > Daniel.Sun > > > > -- > View this message in context: http://groovy.329449.n5. > nabble.com/Traits-and-protected-properties-tp5738002p5738019.html > Sent from the Groovy Dev mailing list archive at Nabble.com. >

Re: Traits and protected properties

2017-01-25 Thread Daniel Sun
Hi Cédric, > having a protected property just cannot work Could you tell me why trait does not support protected property? Thanks, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Traits-and-protected-properties-tp5738002p5738019.html Sent from the Groovy

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
I don't think it's breaking change, since having a protected property just cannot work :) 2017-01-25 13:12 GMT+01:00 Andres Almiray : > +1. > > This being a potential breaking change should IMHO be scheduled for 3.0-ea. > > --- > Java Champion; Groovy Enthu

Re: Traits and protected properties

2017-01-25 Thread Andres Almiray
Any additional constraints that should be checked regarding static members? I'd assume "public static final" fields are injected as constants. What about static methods? I must confess I've never used Groovy traits so far. Cheers, Andres --- Java Champion

Re: Traits and protected properties

2017-01-25 Thread Andres Almiray
+1. This being a potential breaking change should IMHO be scheduled for 3.0-ea. --- Java Champion; Groovy Enthusiast http://jroller.com/aalmiray http://www.linkedin.com/in/aalmiray -- What goes up, must come down. Ask any system administrator. There are 10

Re: Traits and protected properties

2017-01-25 Thread Cédric Champeau
+1, this is an oversight from my side, protected properties should be prohibited too. 2017-01-25 12:56 GMT+01:00 Paul King : > Hi, for traits we explicitly prohibit protected (and package private) > methods - see the doco for some details. For properties however, we > never check (in 2.4.7 and ea

Traits and protected properties

2017-01-25 Thread Paul King
Hi, for traits we explicitly prohibit protected (and package private) methods - see the doco for some details. For properties however, we never check (in 2.4.7 and earlier) for that case (protected) and in fact include the property in the trait as if it was private. I was thinking of adding an extr