summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/reify
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2013-07-29 17:27:03 -0700
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2013-07-29 17:27:03 -0700
commita72f79abf5845d25c847f7d7cde6d28a9d15612e (patch)
treee2c8669276a0ae7ddf8014136d3bedc2ac753dc9 /src/compiler/scala/reflect/reify
parent20cd9474f0a22950c905badb81fb6eeebdf00b34 (diff)
parent1e5bfdb117c1cab659456949549765084081d534 (diff)
downloadscala-a72f79abf5845d25c847f7d7cde6d28a9d15612e.tar.gz
scala-a72f79abf5845d25c847f7d7cde6d28a9d15612e.tar.bz2
scala-a72f79abf5845d25c847f7d7cde6d28a9d15612e.zip
Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.x
Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
Diffstat (limited to 'src/compiler/scala/reflect/reify')
-rw-r--r--src/compiler/scala/reflect/reify/phases/Reshape.scala16
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 ae4a03d232..7578def687 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[analyzer.MacroExpansionAttachment] match {
case Some(analyzer.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
}