Skip to content

Commit 0fad939

Browse files
aherlihydwijnand
authored andcommitted
working but state lost
1 parent f79588b commit 0fad939

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

compiler/src/dotty/tools/repl/ReplDriver.scala

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -551,18 +551,14 @@ class ReplDriver(settings: Array[String],
551551
// println(s"classPath after add = ${state.context.platform.classPath(using state.context).asClassPathString}")
552552

553553
// recreate initial context
554-
rootCtx = setupRootCtx(Array(), rootCtx.fresh.setSetting(rootCtx.settings.classpath, newCP))
554+
resetToInitial(List("-classpath", newCP))
555+
// rootCtx = setupRootCtx(Array(), rootCtx.fresh.setSetting(rootCtx.settings.classpath, newCP))
555556
val s = state.copy(context = rootCtx)
556-
println(s"after setupRootCtx classPath = ${s.context.platform.classPath(using s.context).asClassPathString}")
557-
558557

559558
// new class loader
560-
// val newClassPath = state.context.platform.classPath(using state.context).asURLs :+ f.toURI.toURL
561-
// val oldCL = rendering.classLoader()(using state.context)
562-
// val newCL = fromURLsParallelCapable(newClassPath, oldCL)
563-
// println(s"new CL class path = ${newCL.getURLs.toList}")
564-
// println(s"\nclass name = ${cpCP.className}")
565-
// rendering.myClassLoader = new AbstractFileClassLoader(state.context.settings.outputDir.default, newCL)
559+
val oldCL = rendering.classLoader()(using state.context)
560+
val newCL = fromURLsParallelCapable(s.context.platform.classPath(using s.context).asURLs, oldCL)
561+
rendering.myClassLoader = new AbstractFileClassLoader(state.context.settings.outputDir.default, newCL)
566562
// out.println(s"Added '$path' to classpath.")
567563
s
568564

0 commit comments

Comments
 (0)