summaryrefslogtreecommitdiff
path: root/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala')
-rw-r--r--test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala33
1 files changed, 9 insertions, 24 deletions
diff --git a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
index f0f20acf07..fb05ab8d5a 100644
--- a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
+++ b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
@@ -2,10 +2,7 @@ package scala.tools.nsc
package symtab
import scala.reflect.ClassTag
-import scala.reflect.internal.{Phase, NoPhase, SomePhase}
-import scala.tools.nsc.classpath.FlatClassPath
-import scala.tools.nsc.settings.ClassPathRepresentationType
-import scala.tools.util.FlatClassPathResolver
+import scala.reflect.internal.{NoPhase, Phase, SomePhase}
import scala.tools.util.PathResolver
import util.ClassPath
import io.AbstractFile
@@ -30,8 +27,7 @@ class SymbolTableForUnitTesting extends SymbolTable {
override def isCompilerUniverse: Boolean = true
- def classPath = platform.classPath
- def flatClassPath: FlatClassPath = platform.flatClassPath
+ def classPath: ClassPath = platform.classPath
object platform extends backend.Platform {
val symbolTable: SymbolTableForUnitTesting.this.type = SymbolTableForUnitTesting.this
@@ -39,22 +35,12 @@ class SymbolTableForUnitTesting extends SymbolTable {
def platformPhases: List[SubComponent] = Nil
- lazy val classPath: ClassPath[AbstractFile] = {
- assert(settings.YclasspathImpl.value == ClassPathRepresentationType.Recursive,
- "It's not possible to use the recursive classpath representation, when it's not the chosen classpath scanning method")
- new PathResolver(settings).result
- }
-
- private[nsc] lazy val flatClassPath: FlatClassPath = {
- assert(settings.YclasspathImpl.value == ClassPathRepresentationType.Flat,
- "It's not possible to use the flat classpath representation, when it's not the chosen classpath scanning method")
- new FlatClassPathResolver(settings).result
- }
+ private[nsc] lazy val classPath: ClassPath = new PathResolver(settings).result
def isMaybeBoxed(sym: Symbol): Boolean = ???
def needCompile(bin: AbstractFile, src: AbstractFile): Boolean = ???
def externalEquals: Symbol = ???
- def updateClassPath(subst: Map[ClassPath[AbstractFile], ClassPath[AbstractFile]]): Unit = ???
+ def updateClassPath(subst: Map[ClassPath, ClassPath]): Unit = ???
}
object loaders extends symtab.SymbolLoaders {
@@ -69,10 +55,7 @@ class SymbolTableForUnitTesting extends SymbolTable {
class GlobalMirror extends Roots(NoSymbol) {
val universe: SymbolTableForUnitTesting.this.type = SymbolTableForUnitTesting.this
- def rootLoader: LazyType = settings.YclasspathImpl.value match {
- case ClassPathRepresentationType.Flat => new loaders.PackageLoaderUsingFlatClassPath(FlatClassPath.RootPackage, flatClassPath)
- case ClassPathRepresentationType.Recursive => new loaders.PackageLoader(classPath)
- }
+ def rootLoader: LazyType = new loaders.PackageLoader(ClassPath.RootPackage, classPath)
override def toString = "compiler mirror"
}
@@ -102,7 +85,7 @@ class SymbolTableForUnitTesting extends SymbolTable {
// minimal Run to get Reporting wired
def currentRun = new RunReporting {}
class PerRunReporting extends PerRunReportingBase {
- def deprecationWarning(pos: Position, msg: String): Unit = reporter.warning(pos, msg)
+ def deprecationWarning(pos: Position, msg: String, since: String): Unit = reporter.warning(pos, msg)
}
protected def PerRunReporting = new PerRunReporting
@@ -119,7 +102,9 @@ class SymbolTableForUnitTesting extends SymbolTable {
}
phasesArray
}
- lazy val treeInfo: scala.reflect.internal.TreeInfo{val global: SymbolTableForUnitTesting.this.type} = ???
+ lazy val treeInfo = new scala.reflect.internal.TreeInfo {
+ val global: SymbolTableForUnitTesting.this.type = SymbolTableForUnitTesting.this
+ }
val currentFreshNameCreator = new reflect.internal.util.FreshNameCreator