diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-04-11 17:45:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 17:45:55 +0200 |
commit | 65dc7ad151a38158a45c5836d5e1f0fd48b8e396 (patch) | |
tree | 7d1e2c9d1f848525a7d406e6046559081e70f675 /compiler/src/dotty/tools/dotc/config/JavaPlatform.scala | |
parent | f13e3a43d227933ce644f2503f658ea436ea11b4 (diff) | |
parent | 223f32b7658a77fb2ad6b30ad247c0e27204b558 (diff) | |
download | dotty-65dc7ad151a38158a45c5836d5e1f0fd48b8e396.tar.gz dotty-65dc7ad151a38158a45c5836d5e1f0fd48b8e396.tar.bz2 dotty-65dc7ad151a38158a45c5836d5e1f0fd48b8e396.zip |
Merge pull request #2191 from dotty-staging/sync-classpath-scalac
Fix #2186: Synchronize classpath handling with Scala 2.12
Diffstat (limited to 'compiler/src/dotty/tools/dotc/config/JavaPlatform.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/config/JavaPlatform.scala | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala index 8bc18c387..d2a8e18a2 100644 --- a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala +++ b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala @@ -2,8 +2,8 @@ package dotty.tools package dotc package config -import io.{AbstractFile,ClassPath,JavaClassPath,MergedClassPath,DeltaClassPath} -import ClassPath.{ JavaContext, DefaultJavaContext } +import io._ +import classpath.AggregateClassPath import core._ import Symbols._, Types._, Contexts._, Denotations._, SymDenotations._, StdNames._, Names._ import Flags._, Scopes._, Decorators._, NameOps._, util.Positions._ @@ -11,7 +11,7 @@ import transform.ExplicitOuter, transform.SymUtils._ class JavaPlatform extends Platform { - private var currentClassPath: Option[MergedClassPath] = None + private var currentClassPath: Option[ClassPath] = None def classPath(implicit ctx: Context): ClassPath = { if (currentClassPath.isEmpty) @@ -35,8 +35,12 @@ class JavaPlatform extends Platform { } /** Update classpath with a substituted subentry */ - def updateClassPath(subst: Map[ClassPath, ClassPath]) = - currentClassPath = Some(new DeltaClassPath(currentClassPath.get, subst)) + def updateClassPath(subst: Map[ClassPath, ClassPath]): Unit = currentClassPath.get match { + case AggregateClassPath(entries) => + currentClassPath = Some(AggregateClassPath(entries map (e => subst.getOrElse(e, e)))) + case cp: ClassPath => + currentClassPath = Some(subst.getOrElse(cp, cp)) + } def rootLoader(root: TermSymbol)(implicit ctx: Context): SymbolLoader = new ctx.base.loaders.PackageLoader(root, classPath) |