Hi,
I am trying to write an annotation macro which needs type information about the supertypes. Basically I need to get hold on a Type from a SymTree.
Here’s what it looks like:
def macroImpl(classDef: ClassDef, companionObjectDef: Option[ModuleDef]) = {
val ClassDef(mods, className, typeParams, impl) = classDef
impl.parents.foreach {
//inspect fields and members of supertypes here
//each parent beeing a SymTree (presumably since it's a reference to another definition)
}
}
Theoretically I should do something similar to runtime reflection, where I can get a TypeTag and from there inspect the type. I could not figure out how to do it in a macro though.
Thanks,
Razvan