Permalink
Browse files

Revert "SI-5824 Fix crashes in reify with _*"

This reverts commit 0a25ee3.

It came with a test failure which I overlooked.
  • Loading branch information...
1 parent ff2ca68 commit 950e938bb08afc08ba6b91af5468d0f703924356 @paulp paulp committed Jan 25, 2013
@@ -177,7 +177,7 @@ trait GenTrees {
// then we can reify the scrutinee as a symless AST and that will definitely be hygienic
// why? because then typechecking of a scrutinee doesn't depend on the environment external to the quasiquote
// otherwise we need to reify the corresponding type
- if (tree.symbol.isLocalToReifee || tree.tpe.isLocalToReifee || treeInfo.isWildcardStarType(tree))
+ if (sym.isLocalToReifee || tpe.isLocalToReifee)
reifyProduct(tree)
else {
if (reifyDebug) println("reifying bound type %s (underlying type is %s)".format(sym, tpe))
@@ -187,28 +187,24 @@ trait Reshape {
}
private def toPreTyperTypedOrAnnotated(tree: Tree): Tree = tree match {
- case ty @ Typed(expr1, tpt) =>
+ case ty @ Typed(expr1, tt @ TypeTree()) =>
if (reifyDebug) println("reify typed: " + tree)
- val original = tpt match {
- case tt @ TypeTree() => tt.original
- case tpt => tpt
- }
val annotatedArg = {
def loop(tree: Tree): Tree = tree match {
case annotated1 @ Annotated(ann, annotated2 @ Annotated(_, _)) => loop(annotated2)
case annotated1 @ Annotated(ann, arg) => arg
case _ => EmptyTree
}
- loop(original)
+ loop(tt.original)
}
if (annotatedArg != EmptyTree) {
if (annotatedArg.isType) {
if (reifyDebug) println("verdict: was an annotated type, reify as usual")
ty
} else {
- if (reifyDebug) println("verdict: was an annotated value, equivalent is " + original)
- toPreTyperTypedOrAnnotated(original)
+ if (reifyDebug) println("verdict: was an annotated value, equivalent is " + tt.original)
+ toPreTyperTypedOrAnnotated(tt.original)
}
} else {
if (reifyDebug) println("verdict: wasn't annotated, reify as usual")
@@ -412,13 +412,6 @@ abstract class TreeInfo {
case _ => false
}
- /** Is the argument a wildcard star type of the form `_*`?
- */
- def isWildcardStarType(tree: Tree): Boolean = tree match {
- case Ident(tpnme.WILDCARD_STAR) => true
- case _ => false
- }
-
/** Is this pattern node a catch-all (wildcard or variable) pattern? */
def isDefaultCase(cdef: CaseDef) = cdef match {
case CaseDef(pat, EmptyTree, _) => isWildcardArg(pat)
@@ -1 +0,0 @@
-a b c
@@ -1,8 +0,0 @@
-import scala.reflect.runtime.universe._
-import scala.tools.reflect.Eval
-
-object Test extends App {
- reify {
- println("%s %s %s".format(List("a", "b", "c"): _*))
- }.eval
-}

0 comments on commit 950e938

Please sign in to comment.