summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/macros/contexts
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-02-15 00:35:20 +0100
committerEugene Burmako <xeno.by@gmail.com>2014-02-15 09:32:27 +0100
commit989aa437b903173f938aa8ac2f6783bcc1dd7a99 (patch)
tree7fa8cbb6e064f8fab5f855dc0788699b77c972f6 /src/compiler/scala/reflect/macros/contexts
parent2608db67db46bcbcd5c235b38801a8d863def637 (diff)
downloadscala-989aa437b903173f938aa8ac2f6783bcc1dd7a99.tar.gz
scala-989aa437b903173f938aa8ac2f6783bcc1dd7a99.tar.bz2
scala-989aa437b903173f938aa8ac2f6783bcc1dd7a99.zip
upgrades typingTransform
typingTransform and typingTransform's atOwner now work both with solitary trees and Tree+Symbol couples.
Diffstat (limited to 'src/compiler/scala/reflect/macros/contexts')
-rw-r--r--src/compiler/scala/reflect/macros/contexts/Internals.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/scala/reflect/macros/contexts/Internals.scala b/src/compiler/scala/reflect/macros/contexts/Internals.scala
index cca6d957da..8c784d7e54 100644
--- a/src/compiler/scala/reflect/macros/contexts/Internals.scala
+++ b/src/compiler/scala/reflect/macros/contexts/Internals.scala
@@ -29,6 +29,7 @@ trait Internals extends scala.tools.nsc.transform.TypingTransformers {
def recur(tree: Tree): Tree = hof(tree, this)
def default(tree: Tree): Tree = superTransform(tree)
def atOwner[T](owner: Symbol)(op: => T): T = self.atOwner(owner)(op)
+ def atOwner[T](tree: Tree, owner: Symbol)(op: => T): T = self.atOwner(tree, owner)(op)
def currentOwner: Symbol = self.currentOwner
def typecheck(tree: Tree): Tree = localTyper.typed(tree)
}
@@ -37,5 +38,10 @@ trait Internals extends scala.tools.nsc.transform.TypingTransformers {
}
def typingTransform(tree: Tree)(transformer: (Tree, TypingTransformApi) => Tree): Tree = new HofTypingTransformer(transformer).transform(tree)
+
+ def typingTransform(tree: Tree, owner: Symbol)(transformer: (Tree, TypingTransformApi) => Tree): Tree = {
+ val trans = new HofTypingTransformer(transformer)
+ trans.atOwner(owner)(trans.transform(tree))
+ }
}
} \ No newline at end of file