Skip to content

Commit 5b88356

Browse files
Add comment
1 parent f963bc2 commit 5b88356

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ class InteractiveDriver(settings: List[String]) extends Driver {
190190
if (t.symbol.exists && t.hasType) {
191191
if (!t.symbol.isCompleted) t.symbol.info = UnspecifiedErrorType
192192
t.symbol.annotations.foreach { annot =>
193+
/* In some cases annotations are are used on themself (possibly larger cycles).
194+
* This is the case with the java.lang.annotation.Target annotation, would end
195+
* in an infinite loop while cleaning. The `seen` is added to ensure that those
196+
* trees are not cleand twice.
197+
* TODO: Find a less expensive way to check for those cycles.
198+
*/
193199
if (!seen(annot.tree))
194200
cleanupTree(annot.tree)
195201
}

0 commit comments

Comments
 (0)