File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/interactive Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -299,15 +299,17 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
299299 }
300300
301301 /**
302- * Initialize this driver and compiler by "compiling" a fake, empty source file .
302+ * Initialize this driver and compiler.
303303 *
304304 * This is necessary because an `InteractiveDriver` can be put to work without having
305305 * compiled anything (for instance, resolving a symbol coming from a different compiler in
306- * this compiler). In those cases, an un-initialized compiler will crash.
306+ * this compiler). In those cases, an un-initialized compiler may crash (for instance if
307+ * late-compilation is needed).
307308 */
308309 private [this ] def initialize (): Unit = {
309- val fakeSource = new File (" fake.scala" )
310- run(fakeSource.toURI, " " )
310+ val run = compiler.newRun(myInitCtx.fresh)
311+ myCtx = run.runContext
312+ run.compileUnits(Nil , myCtx)
311313 }
312314
313315}
You can’t perform that action at this time.
0 commit comments