File tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/interactive
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 {
299
299
}
300
300
301
301
/**
302
- * Initialize this driver and compiler by "compiling" a fake, empty source file .
302
+ * Initialize this driver and compiler.
303
303
*
304
304
* This is necessary because an `InteractiveDriver` can be put to work without having
305
305
* 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).
307
308
*/
308
309
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)
311
313
}
312
314
313
315
}
You can’t perform that action at this time.
0 commit comments