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.
This commit is contained in:
Mark Harrah
2012-11-17 20:23:06 -05:00
parent 2c7e9cd893
commit 4cc5bece70
+3 -3
View File
@@ -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