Skip to content

Commit

Permalink
Use computePhaseDescriptors directly
Browse files Browse the repository at this point in the history
This commit does two things:
* In 2.8, `computePhaseDescriptors` was accessed using reflection
  because it was private and inaccessible to `CachedCompiler`.
  However, it was turned into protected later on by scala/scala@1016d68.
  As current Zinc only supports Scala versions 2.10, 2.11 and 2.12, the
  access to `computePhaseDescriptors` is no longer reflective.
* Remove unused imports that cluttered the source file.
  • Loading branch information
jvican committed Feb 16, 2017
1 parent b5c2817 commit 33407c5
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ package xsbt

import xsbti.{ AnalysisCallback, Logger, Problem, Reporter, Severity }
import xsbti.compile._
import scala.tools.nsc.{ backend, io, reporters, symtab, util, Phase, Global, Settings, SubComponent }
import scala.tools.nsc.interactive.RangePositions
import backend.JavaPlatform
import scala.tools.util.PathResolver
import symtab.SymbolLoaders
import util.{ ClassPath, DirectoryClassPath, MergedClassPath, JavaClassPath }
import ClassPath.{ ClassPathContext, JavaContext }
import scala.tools.nsc.{ io, reporters, Phase, Global, Settings, SubComponent }
import scala.tools.nsc.util.ClassPath
import io.AbstractFile
import scala.annotation.tailrec
import scala.collection.mutable
import Log.debug
import java.io.File
Expand Down Expand Up @@ -223,8 +217,7 @@ private final class CachedCompiler0(args: Array[String], output: Output, initial
}
superComputePhaseDescriptors
}
// Required because computePhaseDescriptors is private in 2.8 (changed to protected sometime later).
private[this] def superComputePhaseDescriptors() = superCall("computePhaseDescriptors").asInstanceOf[List[SubComponent]]
private[this] def superComputePhaseDescriptors() = this.computePhaseDescriptors
private[this] def superDropRun(): Unit =
try { superCall("dropRun"); () } catch { case e: NoSuchMethodException => () } // dropRun not in 2.8.1
private[this] def superCall(methodName: String): AnyRef =
Expand Down

0 comments on commit 33407c5

Please sign in to comment.