File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,14 @@ class InteractiveDriver(settings: List[String]) extends Driver {
179179
180180 private val compiler : Compiler = new InteractiveCompiler
181181
182+ private def cleanup (tree : tpd.Tree )(implicit ctx : Context ): Unit = tree.foreachSubTree { t =>
183+ if (t.hasType) {
184+ if (t.symbol.exists && ! t.symbol.isCompleted)
185+ t.symbol.info = UnspecifiedErrorType
186+ }
187+ t.removeAllAttachments()
188+ }
189+
182190 def run (uri : URI , sourceCode : String ): List [MessageContainer ] = {
183191 val previousCtx = myCtx
184192 try {
@@ -200,6 +208,7 @@ class InteractiveDriver(settings: List[String]) extends Driver {
200208 run.compileSources(List (source))
201209 run.printSummary()
202210 val t = run.units.head.tpdTree
211+ cleanup(t)
203212 myOpenedTrees(uri) = topLevelClassTrees(t, source)
204213
205214 reporter.removeBufferedMessages
Original file line number Diff line number Diff line change @@ -92,5 +92,8 @@ object Attachment {
9292 assert(! getAttachment(key).isDefined, s " duplicate attachment for key $key" )
9393 next = new Link (key, value, next)
9494 }
95+
96+ final def removeAllAttachments () =
97+ next = null
9598 }
9699}
You can’t perform that action at this time.
0 commit comments