File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
compiler/src/dotty/tools/dotc/interactive Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -183,17 +183,15 @@ class InteractiveDriver(settings: List[String]) extends Driver {
183183 * typed children if the source contains errors.
184184 */
185185 private def cleanup (tree : tpd.Tree )(implicit ctx : Context ): Unit = {
186- val cleanedTree = mutable.Set .empty[tpd.Tree ]
186+ val seen = mutable.Set .empty[tpd.Tree ]
187187 def cleanupTree (tree : tpd.Tree ): Unit = {
188- cleanedTree += tree
188+ seen += tree
189189 tree.foreachSubTree { t =>
190- if (t.hasType) {
191- if (t.symbol.exists) {
192- if (! t.symbol.isCompleted) t.symbol.info = UnspecifiedErrorType
193- t.symbol.annotations.foreach { annot =>
194- if (! cleanedTree(annot.tree))
195- cleanupTree(annot.tree)
196- }
190+ if (t.symbol.exists && t.hasType) {
191+ if (! t.symbol.isCompleted) t.symbol.info = UnspecifiedErrorType
192+ t.symbol.annotations.foreach { annot =>
193+ if (! seen(annot.tree))
194+ cleanupTree(annot.tree)
197195 }
198196 }
199197 t.removeAllAttachments()
You can’t perform that action at this time.
0 commit comments