summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/reflect
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-21 04:25:44 -0800
committerEugene Burmako <xeno.by@gmail.com>2014-01-21 04:25:44 -0800
commita242101282ba986c4e336b759aaa08a32ca82a7b (patch)
tree6ac44b5195cda51f3a2e54e89c0aa250714797b1 /src/compiler/scala/tools/reflect
parent26387cacaa8f78105419044fc33acc8fd8343662 (diff)
parent752f1eb63e931e04fd2818f32b6ca7e68e4298d2 (diff)
downloadscala-a242101282ba986c4e336b759aaa08a32ca82a7b.tar.gz
scala-a242101282ba986c4e336b759aaa08a32ca82a7b.tar.bz2
scala-a242101282ba986c4e336b759aaa08a32ca82a7b.zip
Merge pull request #3392 from xeno-by/topic/untypecheck
deprecates resetAllAttrs and resetLocalAttrs in favor of the new API
Diffstat (limited to 'src/compiler/scala/tools/reflect')
-rw-r--r--src/compiler/scala/tools/reflect/ToolBox.scala15
-rw-r--r--src/compiler/scala/tools/reflect/ToolBoxFactory.scala2
2 files changed, 11 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/reflect/ToolBox.scala b/src/compiler/scala/tools/reflect/ToolBox.scala
index 236b868842..4c1bc794bc 100644
--- a/src/compiler/scala/tools/reflect/ToolBox.scala
+++ b/src/compiler/scala/tools/reflect/ToolBox.scala
@@ -72,19 +72,22 @@ trait ToolBox[U <: scala.reflect.api.Universe] {
def inferImplicitView(tree: u.Tree, from: u.Type, to: u.Type, silent: Boolean = true, withMacrosDisabled: Boolean = false, pos: u.Position = u.NoPosition): u.Tree
/** Recursively resets symbols and types in a given tree.
- *
- * Note that this does not revert the tree to its pre-typer shape.
- * For more info, read up https://issues.scala-lang.org/browse/SI-5464.
+ * WARNING: Don't use this API, go for [[untypecheck]] instead.
*/
+ @deprecated("Use `tb.untypecheck` instead", "2.11.0")
def resetAllAttrs(tree: u.Tree): u.Tree
/** Recursively resets locally defined symbols and types in a given tree.
- *
- * Note that this does not revert the tree to its pre-typer shape.
- * For more info, read up https://issues.scala-lang.org/browse/SI-5464.
+ * WARNING: Don't use this API, go for [[untypecheck]] instead.
*/
+ @deprecated("Use `tb.untypecheck` instead", "2.11.0")
def resetLocalAttrs(tree: u.Tree): u.Tree
+ /**
+ * @see [[scala.reflect.macros.Typers.untypecheck]]
+ */
+ def untypecheck(tree: u.Tree): u.Tree
+
/** .. */
def parse(code: String): u.Tree
diff --git a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
index af13b7d0ba..4a8c91bd1b 100644
--- a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
+++ b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
@@ -401,6 +401,8 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
uttree
}
+ def untypecheck(tree: u.Tree): u.Tree = resetLocalAttrs(tree)
+
def parse(code: String): u.Tree = withCompilerApi { compilerApi =>
import compilerApi._
if (compiler.settings.verbose) println("parsing "+code)