Skip to content
Browse files

Add a cautionary comment to TreeSymSubstitutor.

  • Loading branch information...
1 parent 695c535 commit f7c9adcd6156a301f3a1cc33f0e07289f44fbf7a @retronym retronym committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/reflect/scala/reflect/internal/Trees.scala
5 src/reflect/scala/reflect/internal/Trees.scala
@@ -1434,6 +1434,11 @@ trait Trees extends api.Trees { self: SymbolTable =>
/** Substitute symbols in `from` with symbols in `to`. Returns a new
* tree using the new symbols and whose Ident and Select nodes are
* name-consistent with the new symbols.
+ *
+ * Note: This is currently a destructive operation on the original Tree.
+ * Trees currently assigned a symbol in `from` will be assigned the new symbols
+ * without copying, and trees that define symbols with an `info` that refer
+ * a symbol in `from` will have a new type assigned.
class TreeSymSubstituter(from: List[Symbol], to: List[Symbol]) extends Transformer {
val symSubst = new SubstSymMap(from, to)

0 comments on commit f7c9adc

Please sign in to comment.
Something went wrong with that request. Please try again.