diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-12 12:00:45 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-12 12:00:45 -0700 |
commit | 8bcb848fd2d00eabe224a9dd6384dbf19d76ce9f (patch) | |
tree | 1d1ab95e4be5d42e41cc5523c9a304770e131e41 /src/compiler | |
parent | 731d41ac87c2ae797c9dcd2b420712b00b802c66 (diff) | |
parent | 6368ae7218c0af651f74a566f718a8b03a547ba2 (diff) | |
download | scala-8bcb848fd2d00eabe224a9dd6384dbf19d76ce9f.tar.gz scala-8bcb848fd2d00eabe224a9dd6384dbf19d76ce9f.tar.bz2 scala-8bcb848fd2d00eabe224a9dd6384dbf19d76ce9f.zip |
Merge pull request #2721 from retronym/ticket/7649
SI-7649 Fix positions for reshaped tag materializers
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/reflect/reify/phases/Reshape.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala index a320718084..535a933c73 100644 --- a/src/compiler/scala/reflect/reify/phases/Reshape.scala +++ b/src/compiler/scala/reflect/reify/phases/Reshape.scala @@ -91,20 +91,20 @@ trait Reshape { private def undoMacroExpansion(tree: Tree): Tree = tree.attachments.get[MacroExpansionAttachment] match { case Some(MacroExpansionAttachment(original)) => + def mkImplicitly(tp: Type) = atPos(tree.pos)( + gen.mkNullaryCall(Predef_implicitly, List(tp)) + ) + val sym = original.symbol original match { // this hack is necessary until I fix implicit macros // so far tag materialization is implemented by sneaky macros hidden in scala-compiler.jar // hence we cannot reify references to them, because noone will be able to see them later // when implicit macros are fixed, these sneaky macros will move to corresponding companion objects // of, say, ClassTag or TypeTag - case Apply(TypeApply(_, List(tt)), _) if original.symbol == materializeClassTag => - gen.mkNullaryCall(Predef_implicitly, List(appliedType(ClassTagClass, tt.tpe))) - case Apply(TypeApply(_, List(tt)), List(pre)) if original.symbol == materializeWeakTypeTag => - gen.mkNullaryCall(Predef_implicitly, List(typeRef(pre.tpe, WeakTypeTagClass, List(tt.tpe)))) - case Apply(TypeApply(_, List(tt)), List(pre)) if original.symbol == materializeTypeTag => - gen.mkNullaryCall(Predef_implicitly, List(typeRef(pre.tpe, TypeTagClass, List(tt.tpe)))) - case _ => - original + case Apply(TypeApply(_, List(tt)), _) if sym == materializeClassTag => mkImplicitly(appliedType(ClassTagClass, tt.tpe)) + case Apply(TypeApply(_, List(tt)), List(pre)) if sym == materializeWeakTypeTag => mkImplicitly(typeRef(pre.tpe, WeakTypeTagClass, List(tt.tpe))) + case Apply(TypeApply(_, List(tt)), List(pre)) if sym == materializeTypeTag => mkImplicitly(typeRef(pre.tpe, TypeTagClass, List(tt.tpe))) + case _ => original } case _ => tree } |