Le 06/03/2016 19:27, Francis Bourre a écrit :
> Thank you Nicolas for your feedback.
>
> In my case @:autobuild is only triggered on the extended class because
> this class implements the interface below (and the super class doesn't):
> /@:autoBuild( hex.core.AnnotationReader.readMetadata() )interface
> IAnnotationContainer /
> /
> /
> I tried this way to retrieve the information of the super class from the
> macro:
> /var superClass = Context.getLocalClass().get().superClass ;/
> /var superFields = superClass.t.get().fields.get();/
>
> But the result is typed 'Array<ClassField> and not Array<Field>, so I
> can't reuse my previous parsing/buidling algorithm on it, to get
> informations recursively.
Yes, you get typed AST, not "parsed" one, which is lost when typing the
class.
The idea is that any data that you want to be passed by your superclass
to its subclasses have to be stored into metadata. Metadata can store
"parsed" expressions.
Best,
Nicolas