Skip to content

Commit 980fcbe

Browse files
committed
Add comment
1 parent a340323 commit 980fcbe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ class InteractiveDriver(settings: List[String]) extends Driver {
179179

180180
private val compiler: Compiler = new InteractiveCompiler
181181

182+
/** Remove attachments and error out completers. The goal is to avoid
183+
* having a completer hanging in a typed tree which can capture the context
184+
* of a previous run. Note that typed trees can have untyped or partially
185+
* typed children if the source contains errors.
186+
*/
182187
private def cleanup(tree: tpd.Tree)(implicit ctx: Context): Unit = tree.foreachSubTree { t =>
183188
if (t.hasType) {
184189
if (t.symbol.exists) {

0 commit comments

Comments
 (0)