@@ -69,18 +69,32 @@ trait Typers {
6969 def inferImplicitView (tree : Tree , from : Type , to : Type , silent : Boolean = true , withMacrosDisabled : Boolean = false , pos : Position = enclosingPosition): Tree
7070
7171 /** Recursively resets symbols and types in a given tree.
72- *
73- * Note that this does not revert the tree to its pre-typer shape.
74- * For more info, read up https://issues.scala-lang.org/browse/SI-5464.
72+ * WARNING: Don't use this API, go for [[untypecheck ]] instead.
7573 */
74+ @ deprecated(" Use `c.untypecheck` instead" , " 2.11.0" )
7675 def resetAllAttrs (tree : Tree ): Tree
7776
7877 /** Recursively resets locally defined symbols and types in a given tree.
79- *
80- * Note that this does not revert the tree to its pre-typer shape.
81- * For more info, read up https://issues.scala-lang.org/browse/SI-5464.
78+ * WARNING: Don't use this API, go for [[untypecheck ]] instead.
8279 */
80+ @ deprecated(" Use `c.untypecheck` instead" , " 2.11.0" )
8381 def resetLocalAttrs (tree : Tree ): Tree
82+
83+ /** In the current implementation of Scala's reflection API, untyped trees (also known as parser trees or unattributed trees)
84+ * are observationally different from typed trees (also known as typer trees, typechecked trees or attributed trees),
85+ *
86+ * Usually, if some compiler API takes a tree, then both untyped and typed trees will do. However in some cases,
87+ * only untyped or only typed trees are appropriate. For example, [[eval ]] only accepts untyped trees and one can only splice
88+ * typed trees inside typed trees. Therefore in the current reflection API, there is a need in functions
89+ * that go back and forth between untyped and typed trees. For this we have [[typecheck ]] and `untypecheck`.
90+ *
91+ * Note that `untypecheck` is currently afflicted by https://issues.scala-lang.org/browse/SI-5464,
92+ * which makes it sometimes corrupt trees so that they don't make sense anymore. Unfortunately, there's no workaround for that.
93+ * We plan to fix this issue soon, but for now please keep it in mind.
94+ *
95+ * @see [[http://stackoverflow.com/questions/20936509/scala-macros-what-is-the-difference-between-typed-aka-typechecked-an-untyped ]]
96+ */
97+ def untypecheck (tree : Tree ): Tree
8498}
8599
86100/** Indicates an error during one of the methods in [[scala.reflect.macros.Typers ]].
0 commit comments