File tree 2 files changed +12
-0
lines changed
compiler/src/dotty/tools/dotc
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 {
179
179
180
180
private val compiler : Compiler = new InteractiveCompiler
181
181
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
+
182
190
def run (uri : URI , sourceCode : String ): List [MessageContainer ] = {
183
191
val previousCtx = myCtx
184
192
try {
@@ -200,6 +208,7 @@ class InteractiveDriver(settings: List[String]) extends Driver {
200
208
run.compileSources(List (source))
201
209
run.printSummary()
202
210
val t = run.units.head.tpdTree
211
+ cleanup(t)
203
212
myOpenedTrees(uri) = topLevelClassTrees(t, source)
204
213
205
214
reporter.removeBufferedMessages
Original file line number Diff line number Diff line change @@ -92,5 +92,8 @@ object Attachment {
92
92
assert(! getAttachment(key).isDefined, s " duplicate attachment for key $key" )
93
93
next = new Link (key, value, next)
94
94
}
95
+
96
+ final def removeAllAttachments () =
97
+ next = null
95
98
}
96
99
}
You can’t perform that action at this time.
0 commit comments