Re: Adding a Trait to a ClassNode during semantic analysis

2016-04-25 Thread Mario Garcia
Ok thanks! Mario 2016-04-25 19:23 GMT+02:00 John Smiljanic : > Two separate compilations. One for the traits and transforms (framework > code). The second for the user scripts that are transformed to dynamically > implement the trait. > > On Apr 22, 2016, at 01:33, Mario Garcia wrote: > > Nice

Re: Adding a Trait to a ClassNode during semantic analysis

2016-04-25 Thread John Smiljanic
Two separate compilations. One for the traits and transforms (framework code). The second for the user scripts that are transformed to dynamically implement the trait. > On Apr 22, 2016, at 01:33, Mario Garcia wrote: > > Nice :) > > Just to get this straight, you compiled the traits first an

Re: Adding a Trait to a ClassNode during semantic analysis

2016-04-22 Thread Mario Garcia
Nice :) Just to get this straight, you compiled the traits first and then you compiled the local transformation and the user-developer code altogether. It's that correct ? 2016-04-21 23:16 GMT+02:00 John Smiljanic : > After some digging I found > org.codehaus.groovy.transform.trait.TraitCompos

Re: Adding a Trait to a ClassNode during semantic analysis

2016-04-21 Thread John Smiljanic
After some digging I found org.codehaus.groovy.transform.trait.TraitComposer and from there I was able to backtrack to how groovy transforms statically defined traits. This is performed in canonalization, so it appears that a trait that is added to a class during semantic analysis may still have i

Re: Adding a Trait to a ClassNode during semantic analysis

2016-04-21 Thread Mario Garcia
I'm afraid the latest CompilePhase where you can use that approach is CONVERSION. That means that in order to achieve what you wanted, you should be using a global transformation. Then you can make the ClassNode to implement the given trait . Hope this helps :) Mario 2016-04-20 22:08 GMT+02:00 J