Skip to content

Commit cd3f017

Browse files
committed
Attempt to update class loader, not successful
1 parent 6c91941 commit cd3f017

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,15 @@ class ReplDriver(settings: Array[String],
529529
}
530530
}
531531

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

540+
// Scala 2:
534541
// def alreadyDefined(clsName: String) = classLoader.tryToLoadClass(clsName).isDefined
535542
// val existingClass = entries.filter(_.ext.isClass).map(classNameOf).find(alreadyDefined)
536543

0 commit comments

Comments
 (0)