@@ -35,10 +35,9 @@ As a first step, we define an annotation that inherits `StaticAnnotation` and de
3535(the name ` macroTransform ` and the signature ` annottees: Any* ` of that macro are important as they tell the macro engine
3636that the enclosing annotation is a macro annotation).
3737
38- import scala.reflect.macros.Context
38+ import scala.annotation.{StaticAnnotation, compileTimeOnly}
3939 import scala.language.experimental.macros
40- import scala.annotation.StaticAnnotation
41- import scala.annotation.compileTimeOnly
40+ import scala.reflect.macros.whitebox
4241
4342 @compileTimeOnly("enable macro paradise to expand macro annotations")
4443 class identity extends StaticAnnotation {
@@ -76,8 +75,17 @@ but we haven't encapsulated this boilerplate in a helper, because compiler plugi
7675(By the way, this boilerplate can be abstracted away by a suitable annotation macro, and we'll probably provide such a macro
7776at a later point in the future).
7877
78+ import scala.annotation.{StaticAnnotation, compileTimeOnly}
79+ import scala.language.experimental.macros
80+ import scala.reflect.macros.whitebox
81+
82+ @compileTimeOnly("enable macro paradise to expand macro annotations")
83+ class identity extends StaticAnnotation {
84+ def macroTransform(annottees: Any*): Any = macro identityMacro.impl
85+ }
86+
7987 object identityMacro {
80- def impl(c: Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {
88+ def impl(c: whitebox. Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {
8189 import c.universe._
8290 val inputs = annottees.map(_.tree).toList
8391 val (annottee, expandees) = inputs match {
0 commit comments