Add -Ywarn-unused & -Ywarn-unused-import, & fix warnings

This commit is contained in:
Dale Wijnand 2016-06-19 11:42:31 +01:00
parent 5f2e56a5a8
commit 8cc4a54c40
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
10 changed files with 5 additions and 20 deletions

View File

@ -94,7 +94,6 @@ object Dag {
*/
private[sbt] def findNegativeCycle[Node](graph: DirectedSignedGraph[Node]): List[graph.Arrow] =
{
import scala.annotation.tailrec
import graph._
val finished = new mutable.HashSet[Node]
val visited = new mutable.HashSet[Node]

View File

@ -3,7 +3,7 @@ package sbt.internal.util
import java.lang.Runnable
import java.util.concurrent.{ atomic, Executor, LinkedBlockingQueue }
import atomic.{ AtomicBoolean, AtomicInteger }
import Types.{ :+:, ConstK, Id }
import Types.{ ConstK, Id }
object EvaluationState extends Enumeration {
val New, Blocked, Ready, Calling, Evaluated = Value

View File

@ -3,8 +3,6 @@
*/
package sbt.internal.util
import Types._
// Used to emulate ~> literals
trait Param[A[_], B[_]] {
type T

View File

@ -278,7 +278,6 @@ trait Init[Scope] {
def flattenLocals(compiled: CompiledMap): Map[ScopedKey[_], Flattened] =
{
import collection.breakOut
val locals = compiled flatMap { case (key, comp) => if (key.key.isLocal) Seq[Compiled[_]](comp) else Nil }
val ordered = Dag.topologicalSort(locals)(_.dependencies.flatMap(dep => if (dep.key.isLocal) Seq[Compiled[_]](compiled(dep)) else Nil))
def flatten(cmap: Map[ScopedKey[_], Flattened], key: ScopedKey[_], deps: Iterable[ScopedKey[_]]): Flattened =
@ -340,11 +339,6 @@ trait Init[Scope] {
derivsByDef.getOrElseUpdate(key, new Deriveds(key, new mutable.ListBuffer)).settings += s
}
// sort derived settings so that dependencies come first
// this is necessary when verifying that a derived setting's dependencies exist
val ddeps = (d: Deriveds) => d.dependencies.flatMap(derivsByDef.get)
val sortedDerivs = Dag.topologicalSort(derivsByDef.values)(ddeps)
// index derived settings by triggering key. This maps a key to the list of settings potentially derived from it.
val derivedBy = new mutable.HashMap[AttributeKey[_], mutable.ListBuffer[Derived]]
for (s <- derived; d <- s.triggeredBy)

View File

@ -3,8 +3,6 @@
*/
package sbt.internal.util
import Types._
// compilation test
object LiteralTest {
def x[A[_], B[_]](f: A ~> B) = f
@ -14,4 +12,4 @@ object LiteralTest {
val a: List[Int] = f(Some(3))
val b: List[String] = f(Some("aa"))
}
}

View File

@ -32,7 +32,6 @@ object SettingsExample extends Init[Scope] {
object SettingsUsage {
import SettingsExample._
import Types._
// Define some keys
val a = AttributeKey[Int]("a")

View File

@ -5,9 +5,8 @@ package sbt.internal.util
import jline.console.ConsoleReader
import jline.console.history.{ FileHistory, MemoryHistory }
import java.io.{ File, InputStream, PrintWriter, FileInputStream, FileDescriptor, FilterInputStream }
import java.io.{ File, InputStream, FileInputStream, FileDescriptor, FilterInputStream }
import complete.Parser
import java.util.concurrent.atomic.AtomicBoolean
import scala.concurrent.duration.Duration
import scala.annotation.tailrec

View File

@ -23,7 +23,6 @@ object EditDistance {
for (i <- 1 to n; s_i = s(i - 1); j <- 1 to m) {
val t_j = t(j - 1)
val cost = if (s_i == t_j) matchCost else if (lower(s_i) == lower(t_j)) caseCost else subCost
val tcost = if (s_i == t_j) matchCost else transposeCost
val c1 = d(i - 1)(j) + deleteCost
val c2 = d(i)(j - 1) + insertCost
@ -39,4 +38,4 @@ object EditDistance {
d(n)(m)
}
}
}

View File

@ -4,7 +4,6 @@
package sbt.internal.util
package complete
import java.io.File
import sbt.io.IO
object HistoryCommands {

View File

@ -5,7 +5,7 @@ package sbt.internal.util
package complete
import jline.console.ConsoleReader
import jline.console.completer.{ CandidateListCompletionHandler, Completer, CompletionHandler }
import jline.console.completer.{ Completer, CompletionHandler }
import scala.annotation.tailrec
import collection.JavaConversions