summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-01-25 13:39:20 -0800
committerPaul Phillips <paulp@improving.org>2013-01-25 13:39:50 -0800
commit950e938bb08afc08ba6b91af5468d0f703924356 (patch)
tree37ec7fc360018b67a2b2b0e235bd322a873e74e1
parentff2ca683cb75b18e8001680aa3ec752929179925 (diff)
downloadscala-950e938bb08afc08ba6b91af5468d0f703924356.tar.gz
scala-950e938bb08afc08ba6b91af5468d0f703924356.tar.bz2
scala-950e938bb08afc08ba6b91af5468d0f703924356.zip
Revert "SI-5824 Fix crashes in reify with _*"
This reverts commit 0a25ee3431d0314c782dd2e6620bc75c4de0d1a4. It came with a test failure which I overlooked.
-rw-r--r--src/compiler/scala/reflect/reify/codegen/GenTrees.scala2
-rw-r--r--src/compiler/scala/reflect/reify/phases/Reshape.scala12
-rw-r--r--src/reflect/scala/reflect/internal/TreeInfo.scala7
-rw-r--r--test/files/run/t5824.check1
-rw-r--r--test/files/run/t5824.scala8
5 files changed, 5 insertions, 25 deletions
diff --git a/src/compiler/scala/reflect/reify/codegen/GenTrees.scala b/src/compiler/scala/reflect/reify/codegen/GenTrees.scala
index fd3673552b..f60089c935 100644
--- a/src/compiler/scala/reflect/reify/codegen/GenTrees.scala
+++ b/src/compiler/scala/reflect/reify/codegen/GenTrees.scala
@@ -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))
diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala
index 71fe4ddeea..5dd5f08b45 100644
--- a/src/compiler/scala/reflect/reify/phases/Reshape.scala
+++ b/src/compiler/scala/reflect/reify/phases/Reshape.scala
@@ -187,12 +187,8 @@ 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)
@@ -200,15 +196,15 @@ trait Reshape {
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")
diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala
index 0a8f1cb9ed..032a4aebef 100644
--- a/src/reflect/scala/reflect/internal/TreeInfo.scala
+++ b/src/reflect/scala/reflect/internal/TreeInfo.scala
@@ -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)
diff --git a/test/files/run/t5824.check b/test/files/run/t5824.check
deleted file mode 100644
index 3774da60e5..0000000000
--- a/test/files/run/t5824.check
+++ /dev/null
@@ -1 +0,0 @@
-a b c
diff --git a/test/files/run/t5824.scala b/test/files/run/t5824.scala
deleted file mode 100644
index 2ad169e2d1..0000000000
--- a/test/files/run/t5824.scala
+++ /dev/null
@@ -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
-}