Scala macro plugin help
Hello, I copied sbt-idea-example to start making a plugin for a macro.
I need help.
If I have a macro annotation that is used like this:
trait Blah2 { protected def defAttr[T] = ()
}
@ExampleAnn
object ExampleObj extends Blah2 {
val A = defAttr[Int]
val B = defAttr[String]
val C = defAttr[Unit]
}
I know how to get a ScObject for ExampleObj, but how can I inspect the body to get a list of:
- ("A", Int)
- ("B", String)
- ("C", Unit)
Please sign in to leave a comment.
I don't know full requirements, so something like this:
That's extremely helpful. Thank you very much!
always fails so instead I just use which is enough.I was able to create a plugin that mostly works for my macro.
In my case
Also I think I've found two issues so I'll raise them on the bug tracker. Thank you again for your help!
getType should work. So it would be great to fix it as well.
Best regards,
Alexander Podkhalyuzin.