Skip to content

Commit

Permalink
Merge pull request #982 from retronym/topic/ct-sym
Browse files Browse the repository at this point in the history
Fix overcompilation with scalac -release by dummy mapping ct.sym entries
  • Loading branch information
eed3si9n authored Jun 2, 2021
2 parents 4250dd7 + 2666eae commit d56686b
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ class MappedFileConverter(rootPaths: Map[String, Path], allowMachinePath: Boolea
case Some((key, rootPath)) =>
MappedVirtualFile(s"$${$key}/${rootPath.relativize(path)}".replace('\\', '/'), rootPaths)
case _ =>
path match {
case p if p.toUri.getScheme == "jrt" => DummyVirtualFile("rt.jar", p)
case p if p.getFileName.toString == "rt.jar" => DummyVirtualFile("rt.jar", p)
case p if allowMachinePath => MappedVirtualFile(s"$p".replace('\\', '/'), rootPaths)
case p => sys.error(s"$p cannot be mapped using the root paths $rootPaths")
}
def isCtSym =
path.getFileSystem
.provider()
.getScheme == "jar" && path.getFileSystem.toString.endsWith("ct.sym")
def isJrt = path.getFileSystem.provider().getScheme == "jrt"
if (isJrt || path.getFileName.toString == "rt.jar" || isCtSym)
DummyVirtualFile("rt.jar", path)
else if (allowMachinePath) MappedVirtualFile(s"$path".replace('\\', '/'), rootPaths)
else sys.error(s"$path cannot be mapped using the root paths $rootPaths")
}
}
}
Expand Down

0 comments on commit d56686b

Please sign in to comment.