groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Garcia <mario.g...@gmail.com>
Subject Re: Adding a Trait to a ClassNode during semantic analysis
Date Thu, 21 Apr 2016 18:10:16 GMT
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 John Smiljanic <john.smiljanic@gmail.com>:

> Hi All,
>
> Groovy 2.3.7.
>
> I've been experimenting with trying to add a Trait (or Mixin) to a
> ClassNode during semantic analysis (compiler phase).  I've tried using
> ClassNode::addInterface and ClassNode::addMixin passing the appropriate.  I
> sort of expected ClassNode to have an addTrait or something like.
>
> Is setting a trait at this phase of compilation supported?
>
> JR
>

Mime
View raw message