summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/reify/phases/Reshape.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/reflect/reify/phases/Reshape.scala')
-rw-r--r--src/compiler/scala/reflect/reify/phases/Reshape.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala
index 5dd5f08b45..71fe4ddeea 100644
--- a/src/compiler/scala/reflect/reify/phases/Reshape.scala
+++ b/src/compiler/scala/reflect/reify/phases/Reshape.scala
@@ -187,8 +187,12 @@ trait Reshape {
}
private def toPreTyperTypedOrAnnotated(tree: Tree): Tree = tree match {
- case ty @ Typed(expr1, tt @ TypeTree()) =>
+ case ty @ Typed(expr1, tpt) =>
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)
@@ -196,15 +200,15 @@ trait Reshape {
case _ => EmptyTree
}
- loop(tt.original)
+ loop(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 " + tt.original)
- toPreTyperTypedOrAnnotated(tt.original)
+ if (reifyDebug) println("verdict: was an annotated value, equivalent is " + original)
+ toPreTyperTypedOrAnnotated(original)
}
} else {
if (reifyDebug) println("verdict: wasn't annotated, reify as usual")