@specialized(Int) のような注釈を複製したいとしましょう。何かのようなもの:
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
注釈の引数 (例では Int) にアクセスする方法はありますか?