diff options
author | Paul Phillips <paulp@improving.org> | 2012-07-27 05:46:12 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-07-27 05:48:09 -0700 |
commit | f15dc74394c225cb6c323e96f107deb6ad0e9645 (patch) | |
tree | 6195b7599a1a26abb0fc500548b1c09da306845b /src/compiler | |
parent | a4bb3b679add3fec8c19f07cc717177c52f3dd92 (diff) | |
download | scala-f15dc74394c225cb6c323e96f107deb6ad0e9645.tar.gz scala-f15dc74394c225cb6c323e96f107deb6ad0e9645.tar.bz2 scala-f15dc74394c225cb6c323e96f107deb6ad0e9645.zip |
Eliminated all the current feature warnings.
This pretty much takes us down to deprecation and inliner warnings.
Diffstat (limited to 'src/compiler')
6 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/cmd/CommandLine.scala b/src/compiler/scala/tools/cmd/CommandLine.scala index d9a74a698c..ced3a97380 100644 --- a/src/compiler/scala/tools/cmd/CommandLine.scala +++ b/src/compiler/scala/tools/cmd/CommandLine.scala @@ -7,7 +7,6 @@ package scala.tools package cmd import scala.collection.mutable.ListBuffer -import language.postfixOps trait CommandLineConfig { def enforceArity: Boolean = true diff --git a/src/compiler/scala/tools/cmd/FromString.scala b/src/compiler/scala/tools/cmd/FromString.scala index 415940b3fd..d473796f39 100644 --- a/src/compiler/scala/tools/cmd/FromString.scala +++ b/src/compiler/scala/tools/cmd/FromString.scala @@ -43,7 +43,7 @@ object FromString { else cmd.runAndExit(println("'%s' is not an existing directory." format s)) } def ExistingDirRelativeTo(root: Directory) = new FromString[Directory]()(tagOfDirectory) { - private def resolve(s: String) = toDir(s) toAbsoluteWithRoot root toDirectory + private def resolve(s: String) = (toDir(s) toAbsoluteWithRoot root).toDirectory override def isDefinedAt(s: String) = resolve(s).isDirectory def apply(s: String): Directory = if (isDefinedAt(s)) resolve(s) diff --git a/src/compiler/scala/tools/cmd/package.scala b/src/compiler/scala/tools/cmd/package.scala index 5786b00fd1..8e74e6169e 100644 --- a/src/compiler/scala/tools/cmd/package.scala +++ b/src/compiler/scala/tools/cmd/package.scala @@ -8,6 +8,10 @@ package scala.tools package object cmd { def returning[T](x: T)(f: T => Unit): T = { f(x) ; x } + // make some language features in this package compile without warning + implicit def implicitConversions = language.implicitConversions + implicit def postfixOps = language.postfixOps + private[cmd] def debug(msg: String) = println(msg) def runAndExit(body: => Unit): Nothing = { diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 025046f19e..e590a0b691 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -1159,7 +1159,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { val linkedClass = moduleClass.companionClass val linkedModule = linkedClass.companionSymbol lazy val conflictingNames: Set[Name] = { - linkedClass.info.members collect { case sym if sym.name.isTermName => sym.name } toSet + (linkedClass.info.members collect { case sym if sym.name.isTermName => sym.name }).toSet } debuglog("Potentially conflicting names for forwarders: " + conflictingNames) @@ -1351,7 +1351,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { val ps = c.symbol.info.parents val superInterfaces0: List[Symbol] = if(ps.isEmpty) Nil else c.symbol.mixinClasses; - val superInterfaces = superInterfaces0 ++ c.symbol.annotations.flatMap(ann => newParentForAttr(ann.symbol)) distinct + val superInterfaces = (superInterfaces0 ++ c.symbol.annotations.flatMap(ann => newParentForAttr(ann.symbol))).distinct if(superInterfaces.isEmpty) EMPTY_STRING_ARRAY else mkArray(minimizeInterfaces(superInterfaces) map javaName) @@ -3183,7 +3183,7 @@ abstract class GenASM extends SubComponent with BytecodeWriters { hops ::= prev if (hops.contains(dest)) { // leave infinite-loops in place - return (dest, hops filterNot (dest eq)) + return (dest, hops filterNot (dest eq _)) } prev = dest; false diff --git a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala index a37fdc3ed1..58c2426602 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala @@ -139,7 +139,7 @@ trait JavaScanners extends ast.parser.ScannersCommon { kwOffset = offset arr } - final val tokenName = allKeywords map (_.swap) toMap + final val tokenName = allKeywords.map(_.swap).toMap //Token representation ----------------------------------------------------- diff --git a/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala b/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala index a378a95786..fe82af5b23 100644 --- a/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala @@ -14,7 +14,7 @@ import util.returning abstract class TreeCheckers extends Analyzer { import global._ - private def classstr(x: AnyRef) = x.getClass.getName split """\\.|\\$""" last; + private def classstr(x: AnyRef) = (x.getClass.getName split """\\.|\\$""").last private def typestr(x: Type) = " (tpe = " + x + ")" private def treestr(t: Tree) = t + " [" + classstr(t) + "]" + typestr(t.tpe) private def ownerstr(s: Symbol) = "'" + s + "'" + s.locationString |