Skip to content

Commit f4968e7

Browse files
aherlihydwijnand
authored andcommitted
Attempt to update class loader, not successful
1 parent d528014 commit f4968e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,15 @@ class ReplDriver(settings: Array[String],
534534
}
535535
}
536536

537+
// TODO: no idea how to access and reload the class paths
538+
val newClassPath = state.context.platform.classPath(using state.context).asURLs :+ f.toURI.toURL
539+
println(s"new class path=${newClassPath.mkString(", ")}")
537540
val clsl = rendering.classLoader()(using state.context)
541+
val newClsl = fromURLsParallelCapable(newClassPath, clsl)
542+
println(s"newClsl getResource=${newClsl.getURLs.toList}")
543+
newClsl.asContext(state.context)
538544

545+
// Scala 2:
539546
// def alreadyDefined(clsName: String) = classLoader.tryToLoadClass(clsName).isDefined
540547
// val existingClass = entries.filter(_.ext.isClass).map(classNameOf).find(alreadyDefined)
541548

0 commit comments

Comments
 (0)