Skip to content

Instantly share code, notes, and snippets.

@aztek
Created January 13, 2013 11:11
Show Gist options
  • Save aztek/4523565 to your computer and use it in GitHub Desktop.
Save aztek/4523565 to your computer and use it in GitHub Desktop.
diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala
index f31c3d4..ce243d9 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, tt) =>
if (reifyDebug) println("reify typed: " + tree)
+ val t = tt match {
+ case tt @ TypeTree() => tt.original
+ case tt => tt
+ }
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(t)
}
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 " + t)
+ toPreTyperTypedOrAnnotated(t)
}
} else {
if (reifyDebug) println("verdict: wasn't annotated, reify as usual")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment