Closed
Description
A program should not be able to see the classes of the compiler that's compiling it unless the compiler's classes are explicitly added to the compilation (user) classpath. Currently, they all leak through by default (you have one chance to opt-out by not setting usejavacp): https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/config/PathResolver.scala#L227
This is not a problem in sbt (it manages the classpath itself), and you might consider it a feature in the REPL, but it's pretty complicated for build tools to navigate the maze of settings. Would be good to clean this up early on.
Activity
gkossakowski commentedon Mar 5, 2014
An example of a problem: https://issues.scala-lang.org/browse/SI-8358
smarter commentedon Nov 18, 2015
@adriaanm : is this fixed/planned to be fixed in Scala 2.12 ?
adriaanm commentedon Nov 18, 2015
No, but we were just talking about tackling this in 2.13 earlier this week!
SethTisue commentedon Nov 18, 2015
the context being, this is important if we want to support alternate and/or slimmer “standard” libraries as in Martin's proposal at scala/slip#31
while
from the language #5440smarter commentedon Jan 26, 2019
Starting with Java 9, we cannot inspect the Java bootclasspath anymore, so I think the problem basically solved itself :). (
usejavacp
still exists, but I think that's OK since it's not enabled by default)Merge pull request scala#44 from noti0na1/dotty-explicit-nulls-only
Merge pull request scala#44 from scala/backport-lts-3.3-21814