-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #2186: Synchronize classpath handling with Scala 2.12 #2191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
36ae1a5
to
bf3326c
Compare
Responding to myself: this was handled by |
Right. I just figured out the same thing :-). |
bf3326c
to
6cd429d
Compare
This is pretty cool: |
This commit is a very crude port of the classpath handling as it exists in the 2.12.x branch of scalac (hash: 232d95a198c94da0c6c8393624e83e9b9ac84e81), this replaces the existing Classpath code that was adapted from scalac years ago. This code was written by Grzegorz Kossakowski, Michał Pociecha, Lukas Rytz, Jason Zaugg and other scalac contributors, many thanks to them! For more information on this implementation, see the description of the PR that originally added it to scalac: scala/scala#4060 Changes made to the copied code to get it to compile with dotty: - Rename scala.tools.nsc.util.ClassPath to dotty.tools.io.ClassPath - Rename scala.tools.nsc.classpath.* to dotty.tools.dotc.classpath.* - Replace "private[nsc]" by "private[dotty]" - Changed `isClass` methods in FileUtils to skip Scala 2.11 implementation classes (needed until we stop being retro-compatible with Scala 2.11) I also copied PlainFile.scala from scalac to get access to `PlainNioFile`.
`dir.listFiles` will return null if called on a directory that no longer exists, somehow partest triggers that.
6cd429d
to
223f32b
Compare
LGTM |
Since scala#2191, `dotty.tools.dotc.io.PlainFile` is no longer an alias for `scala.reflect.io.PlainFile` but its own class. However, the backend still uses PlainFile from scala.reflect. This mess should soon be fixed by getting rid of scala-reflect (scala#2271). Meanwhile, this commit fixes ExtractDependencies to pattern match on the correct class, and thus avoid missing dependencies.
Since scala#2191, `dotty.tools.dotc.io.PlainFile` is no longer an alias for `scala.reflect.io.PlainFile` but its own class. However, the backend still uses PlainFile from scala.reflect. This mess should soon be fixed by getting rid of scala-reflect (scala#2271). Meanwhile, this commit fixes ExtractDependencies to pattern match on the correct class, and thus avoid missing dependencies.
Related: scala/bug#10289 |
@DarkDimius Thanks for pointing me to that, I opened #2317 to keep track of it. |
This commit is a very crude port of the classpath handling as it exists
in the 2.12.x branch of scalac (hash: 232d95a198c94da0c6c8393624e83e9b9ac84e81),
this replaces the existing Classpath code that was adapted from scalac
years ago.
I'll update this commit with more details and proper attribution later,
for now I just want to run this on the CI.
@odersky I had to add a special case to
PackageLoader
to make sure that Scala2 impl classes (ending with$class
) were not entered in scope, do you know how we avoided impl classes being in scope so far?