From 4cc5bece7082a2a5a49e17d240ffca0b70b24026 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sat, 25 Aug 2012 11:53:39 -0400 Subject: [PATCH] address a valid unchecked warning In order to correctly pattern match Tree subclasses in reflection/macros, scalac needs the corresponding implicit for *Tag available because the types are only abstract types. --- main/settings/TaskMacro.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/settings/TaskMacro.scala b/main/settings/TaskMacro.scala index 344b90351..b8e2e0606 100644 --- a/main/settings/TaskMacro.scala +++ b/main/settings/TaskMacro.scala @@ -118,16 +118,16 @@ object TaskMacro private[this] def appendMacroImpl(c: Context)(init: c.Tree, append: c.Tree)(newName: String): c.Tree = { - import c.universe.{Apply,newTermName,Select,TypeApply} + import c.universe.{Apply,ApplyTag,newTermName,Select,SelectTag,TypeApply,TypeApplyTag} c.macroApplication match { - case Apply(Apply(TypeApply(Select(preT, nmeT), targs), _), a) => + case Apply(Apply(TypeApply(Select(preT, nmeT), targs), _), a) => Apply(Apply(TypeApply(Select(preT, newTermName(newName).encodedName), targs), init :: Nil), a) case x => unexpectedTree(x) } } private[this] def transformMacroImpl(c: Context)(init: c.Tree)(newName: String): c.Tree = { - import c.universe.{Apply,newTermName,Select} + import c.universe.{Apply,ApplyTag,newTermName,Select,SelectTag} val target = c.macroApplication match { case Apply(Select(prefix, _), _) => prefix