diff options
Diffstat (limited to 'test/files/run/macro-subpatterns/Macro_1.scala')
-rw-r--r-- | test/files/run/macro-subpatterns/Macro_1.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/files/run/macro-subpatterns/Macro_1.scala b/test/files/run/macro-subpatterns/Macro_1.scala index 2de6b4da9d..e009e411a2 100644 --- a/test/files/run/macro-subpatterns/Macro_1.scala +++ b/test/files/run/macro-subpatterns/Macro_1.scala @@ -4,15 +4,14 @@ import language.experimental.macros object Extractor { def unapply(x: Any): Any = macro unapplyImpl def unapplyImpl(c: Context)(x: c.Tree) = { - val st = c.universe.asInstanceOf[reflect.internal.SymbolTable] - import st._ - val subpatterns = x.attachments.get[SubpatternsAttachment].get.patterns + import c.universe._ + import internal._ q""" new { def isEmpty = false - def get = ${subpatterns.toString} + def get = ${subpatterns(x).toString} def unapply(x: Any) = this - }.unapply(${x.asInstanceOf[st.Tree]}) - """.asInstanceOf[c.Tree] + }.unapply($x) + """ } } |