summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-08-22 21:27:49 +0000
committerPaul Phillips <paulp@improving.org>2009-08-22 21:27:49 +0000
commita8edce124f7badd1570fa6a125b02ba654897c6a (patch)
treedd1ede64796b4f92e7dac6225d3b8a6325c2009e /src/compiler
parent27fc24b0a2251e6817c737399544b9cc0dbf4ef4 (diff)
downloadscala-a8edce124f7badd1570fa6a125b02ba654897c6a.tar.gz
scala-a8edce124f7badd1570fa6a125b02ba654897c6a.tar.bz2
scala-a8edce124f7badd1570fa6a125b02ba654897c6a.zip
These might be the last of the deprecation warn...
These might be the last of the deprecation warnings I can obey in good conscience without doing some less robotic work first. Most of the remaining deprecations do any of: * deprecate in favor of non-existent function * deprecate in favor of function which doesn't quite work yet e.g. List.{ map2, forall2 } * deprecate in favor of function which blows the stack (Iterator.append says to use ++ but this ends poorly, see nsc's TreeSet) * deprecate in favor of a function which doesn't do the same thing e.g. List.-- says to use diff instead, but List(1,1) -- List(1) != List(1,1) diff List(1)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/InterpreterLoop.scala2
-rw-r--r--src/compiler/scala/tools/nsc/PhaseAssembly.scala6
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interactive/BuildManager.scala4
-rwxr-xr-xsrc/compiler/scala/tools/nsc/interactive/Global.scala2
-rw-r--r--src/compiler/scala/tools/nsc/io/VirtualDirectory.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala4
-rw-r--r--src/compiler/scala/tools/nsc/util/TreeSet.scala4
8 files changed, 14 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
index 50ad59d38e..4d2228b6fd 100644
--- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala
+++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
@@ -405,7 +405,7 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) {
/** process command-line arguments and do as they request */
def main(args: Array[String]) {
def error1(msg: String) = out println ("scala: " + msg)
- val command = new InterpreterCommand(List fromArray args, error1)
+ val command = new InterpreterCommand(args.toList, error1)
def neededHelp(): String =
(if (command.settings.help.value) command.usageMsg + "\n" else "") +
(if (command.settings.Xhelp.value) command.xusageMsg + "\n" else "")
diff --git a/src/compiler/scala/tools/nsc/PhaseAssembly.scala b/src/compiler/scala/tools/nsc/PhaseAssembly.scala
index 0679990a9b..918b56fcfb 100644
--- a/src/compiler/scala/tools/nsc/PhaseAssembly.scala
+++ b/src/compiler/scala/tools/nsc/PhaseAssembly.scala
@@ -105,14 +105,14 @@ trait PhaseAssembly { self: Global =>
var chain: List[SubComponent] = Nil
var lvl = 1
- var nds = nodes.values.filter(_.level == lvl).toList
+ var nds = nodes.valuesIterator.filter(_.level == lvl).toList
while(nds.size > 0) {
nds = nds.sort((n1,n2) => (n1.phasename compareTo n2.phasename) < 0)
for (n <- nds) {
chain = chain ::: n.phaseobj.get
}
lvl += 1
- nds = nodes.values.filter(_.level == lvl).toList
+ nds = nodes.valuesIterator.filter(_.level == lvl).toList
}
chain
}
@@ -203,7 +203,7 @@ trait PhaseAssembly { self: Global =>
* dependency on something that is dropped.
*/
def removeDanglingNodes() {
- var dnodes = nodes.values.filter(_.phaseobj.isEmpty)
+ var dnodes = nodes.valuesIterator filter (_.phaseobj.isEmpty)
for (node <- dnodes) {
val msg = "dropping dependency on node with no phase object: "+node.phasename
informProgress(msg)
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index ed75a563b5..061b64d911 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -109,7 +109,7 @@ class Settings(errorFn: String => Unit) extends ScalacSettings {
// if arg is of form -Xfoo:bar,baz,quux
def parseColonArg(s: String): Option[List[String]] = {
- val idx = s.findIndexOf(_ == ':')
+ val idx = s indexWhere (_ == ':')
val (p, args) = (s.substring(0, idx), s.substring(idx+1).split(",").toList)
// any non-Nil return value means failure and we return s unmodified
diff --git a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
index 3512d17bb8..4ecd13b01d 100644
--- a/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/BuildManager.scala
@@ -53,7 +53,7 @@ object BuildManagerTest extends EvalLoop {
Set.empty ++ (fs map AbstractFile.getFile)
val settings = new Settings(error)
- val command = new CompilerCommand(List.fromArray(args), settings, error, false)
+ val command = new CompilerCommand(args.toList, settings, error, false)
// settings.make.value = "off"
// val buildManager: BuildManager = new SimpleBuildManager(settings)
val buildManager: BuildManager = new RefinedBuildManager(settings)
@@ -62,7 +62,7 @@ object BuildManagerTest extends EvalLoop {
// enter resident mode
loop { line =>
- val args = List.fromString(line, ' ')
+ val args = line.split(' ').toList
val command = new CompilerCommand(args, new Settings(error), error, true)
buildManager.update(command.files, Set.empty)
}
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 40af4d389a..7fac3f7fad 100755
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -215,7 +215,7 @@ self =>
reporter.reset
firsts = firsts filter (s => unitOfFile contains (s.file))
val prefix = firsts map unitOf
- val units = prefix ::: (unitOfFile.values.toList diff prefix) filter (!_.isUpToDate)
+ val units = prefix ::: (unitOfFile.valuesIterator.toList diff prefix) filter (!_.isUpToDate)
recompile(units)
if (debugIDE) inform("Everything is now up to date")
}
diff --git a/src/compiler/scala/tools/nsc/io/VirtualDirectory.scala b/src/compiler/scala/tools/nsc/io/VirtualDirectory.scala
index ff4768c6f8..16381bbe6e 100644
--- a/src/compiler/scala/tools/nsc/io/VirtualDirectory.scala
+++ b/src/compiler/scala/tools/nsc/io/VirtualDirectory.scala
@@ -51,7 +51,7 @@ extends AbstractFile {
// the toList is so that the directory may continue to be
// modified while its elements are iterated
- def iterator = files.values.toList.iterator
+ def iterator = files.valuesIterator.toList.iterator
override def lookupName(name: String, directory: Boolean): AbstractFile = {
files.get(name) match {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 80c3fa1ade..d31b014f4e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -676,7 +676,7 @@ trait Infer {
val argtpes1 = argtpes map {
case NamedType(name, tp) => // a named argument
var res = tp
- val pos = params.findIndexOf(p => p.name == name && !p.hasFlag(SYNTHETIC))
+ val pos = params.indexWhere(p => p.name == name && !p.hasFlag(SYNTHETIC))
if (pos == -1) {
if (positionalAllowed) { // treat assignment as positional argument
argPos(index) = index
@@ -1117,7 +1117,7 @@ trait Infer {
val detargs = if (keepNothings || (targs eq null)) targs
else adjustTypeArgs(tparams, targs, WildcardType, uninstantiated)
val undetparams = uninstantiated.toList
- val detparams = tparams remove (undetparams contains _)
+ val detparams = tparams filterNot (undetparams contains _)
substExpr(tree, detparams, detargs, pt)
if (inferInfo)
println("inferred expr instance "+tree+", detargs = "+detargs+", undetparams = "+undetparams)
diff --git a/src/compiler/scala/tools/nsc/util/TreeSet.scala b/src/compiler/scala/tools/nsc/util/TreeSet.scala
index 4f9e9f0a2d..1862212467 100644
--- a/src/compiler/scala/tools/nsc/util/TreeSet.scala
+++ b/src/compiler/scala/tools/nsc/util/TreeSet.scala
@@ -43,9 +43,11 @@ class TreeSet[T >: Null <: AnyRef](less: (T, T) => Boolean) extends Set[T] {
def iterator = {
def elems(t: Tree): Iterator[T] = {
- var it = Iterator.single(t.elem)
+ var it = Iterator single t.elem
if (t.l ne null) it = elems(t.l) append it
if (t.r ne null) it = it append elems(t.r)
+ // if (t.l ne null) it = elems(t.l) ++ it
+ // if (t.r ne null) it = it ++ elems(t.r)
it
}
if (tree eq null) Iterator.empty else elems(tree)