Let's say I wanted to replicate an annotation like @specialized(Int)--crazy I know--using macro annotations. Something like:
class expand(expanded: Any*) extends Annotation with StaticAnnotation {
def macroTransform(annottees: Any*) = macro expand.expandImpl
}
object expand {
def expandImpl(c: Context)(annottees: c.Expr[Any]*):c.Expr[Any] = {
// would like to be able to get access to the "expanded" args above.
???
}
}
// Usage:
def foo[@expand(Int) T] = 4
Run Code Online (Sandbox Code Playgroud)
Is there any way to get access to the arguments of the annotation (Int in the …