summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-01-22 13:14:32 +0000
committermichelou <michelou@epfl.ch>2008-01-22 13:14:32 +0000
commita17c5450868f5cf2213402b8135a8f3916418f25 (patch)
treeec6b598cc08bf627b02bc52a18ff70941be51730 /src
parent51e784b21583c30982e1a6d5de5140ab759ffd06 (diff)
downloadscala-a17c5450868f5cf2213402b8135a8f3916418f25.tar.gz
scala-a17c5450868f5cf2213402b8135a8f3916418f25.tar.bz2
scala-a17c5450868f5cf2213402b8135a8f3916418f25.zip
removed some warnings
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Interpreter.scala4
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/Members.scala46
-rw-r--r--src/compiler/scala/tools/nsc/symtab/StdNames.scala6
3 files changed, 31 insertions, 25 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala
index 42c54a759b..1f8fc0b059 100644
--- a/src/compiler/scala/tools/nsc/Interpreter.scala
+++ b/src/compiler/scala/tools/nsc/Interpreter.scala
@@ -775,11 +775,11 @@ class Interpreter(val settings: Settings, out: PrintWriter) {
case rawType => rawType
}
- map + name -> compiler.atPhase(objRun.typerPhase.next) { cleanedType.toString }
+ map + Pair(name, compiler.atPhase(objRun.typerPhase.next) { cleanedType.toString })
})
}
- val names1 = getTypes(valAndVarNames, n=>compiler.nme.getterToLocal(n))
+ val names1 = getTypes(valAndVarNames, n => compiler.nme.getterToLocal(n))
val names2 = getTypes(defNames, identity)
names1 ++ names2
}
diff --git a/src/compiler/scala/tools/nsc/backend/icode/Members.scala b/src/compiler/scala/tools/nsc/backend/icode/Members.scala
index c9be72308e..f58cc1234e 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/Members.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/Members.scala
@@ -1,5 +1,5 @@
/* NSC -- new scala compiler
- * Copyright 2005-2007 LAMP/EPFL
+ * Copyright 2005-2008 LAMP/EPFL
* @author Martin Odersky
*/
@@ -89,9 +89,9 @@ trait Members { self: ICodes =>
if (!visited(b)) {
f(b, visited);
blockToVisit = b.successors ::: xs;
- visited += b -> true;
+ visited += Pair(b, true)
} else
- blockToVisit = xs;
+ blockToVisit = xs
case _ =>
error("impossible match")
}
@@ -102,9 +102,9 @@ trait Members { self: ICodes =>
override def toString() : String = "ICode '" + label + "'";
/* Compute a unique new label */
- def nextLabel = {
- currentLabel = currentLabel + 1;
- currentLabel;
+ def nextLabel: Int = {
+ currentLabel += 1
+ currentLabel
}
/* Create a new block and append it to the list
@@ -159,21 +159,21 @@ trait Members { self: ICodes =>
* finished (GenICode does that).
*/
class IMethod(val symbol: Symbol) {
- var code: Code = null;
- var native = false;
+ var code: Code = null
+ var native = false
/** The list of exception handlers, ordered from innermost to outermost. */
- var exh: List[ExceptionHandler] = Nil;
- var sourceFile: String = _;
- var returnType: TypeKind = _;
+ var exh: List[ExceptionHandler] = Nil
+ var sourceFile: String = _
+ var returnType: TypeKind = _
var recursive: Boolean = false
/** local variables and method parameters */
- var locals: List[Local] = Nil;
+ var locals: List[Local] = Nil
/** method parameters */
- var params: List[Local] = Nil;
+ var params: List[Local] = Nil
def setCode(code: Code): IMethod = {
this.code = code;
@@ -188,17 +188,20 @@ trait Members { self: ICodes =>
l
}
- def addLocals(ls: List[Local]): Unit =
- ls foreach { l => addLocal(l); };
+ def addLocals(ls: List[Local]) {
+ ls foreach addLocal
+ }
- def addParam(p: Local): Unit =
+ def addParam(p: Local) {
if (!(params contains p)) {
params = p :: params;
locals = p :: locals;
}
+ }
- def addParams(as: List[Local]): Unit =
- as foreach addParam;
+ def addParams(as: List[Local]) {
+ as foreach addParam
+ }
def lookupLocal(n: Name): Option[Local] =
locals find ((l) => l.sym.name == n);
@@ -206,8 +209,9 @@ trait Members { self: ICodes =>
def lookupLocal(sym: Symbol): Option[Local] =
locals find ((l) => l.sym == sym);
- def addHandler(e: ExceptionHandler): Unit =
- exh = e :: exh;
+ def addHandler(e: ExceptionHandler) {
+ exh = e :: exh
+ }
/** Is this method deferred ('abstract' in Java sense) */
def isDeferred = (
@@ -224,7 +228,7 @@ trait Members { self: ICodes =>
import opcodes._
def checkLocals: Unit = if (code ne null) {
Console.println("[checking locals of " + this + "]")
- for (val bb <- code.blocks; val i <- bb.toList) i match {
+ for (bb <- code.blocks; i <- bb.toList) i match {
case LOAD_LOCAL(l) =>
if (!this.locals.contains(l))
Console.println("Local " + l + " is not declared in " + this)
diff --git a/src/compiler/scala/tools/nsc/symtab/StdNames.scala b/src/compiler/scala/tools/nsc/symtab/StdNames.scala
index f1377b4808..1a2921bc1c 100644
--- a/src/compiler/scala/tools/nsc/symtab/StdNames.scala
+++ b/src/compiler/scala/tools/nsc/symtab/StdNames.scala
@@ -1,5 +1,5 @@
/* NSC -- new Scala compiler
- * Copyright 2005-2007 LAMP/EPFL
+ * Copyright 2005-2008 LAMP/EPFL
* @author Martin Odersky
*/
// $Id$
@@ -256,6 +256,7 @@ trait StdNames {
val assume_ = newTermName("assume")
val asInstanceOf_ = newTermName("asInstanceOf")
val asInstanceOfErased = newTermName("asInstanceOf$erased")
+ val bind = newTermName("bind")
val booleanValue = newTermName("booleanValue")
val box = newTermName("box")
val boxArray = newTermName("boxArray")
@@ -323,6 +324,7 @@ trait StdNames {
val self = newTermName("self")
val send = newTermName("send")
val synchronized_ = newTermName("synchronized")
+ val tag = newTermName("$tag")
val tail = newTermName("tail")
val toList = newTermName("toList")
val toString_ = newTermName("toString")
@@ -333,11 +335,11 @@ trait StdNames {
val true_ = newTermName("true")
val unapply = newTermName("unapply")
val unapplySeq = newTermName("unapplySeq")
+ val unbind = newTermName("unbind")
val unbox = newTermName("unbox")
val update = newTermName("update")
val value = newTermName("value")
val view_ = newTermName("view")
- val tag = newTermName("$tag")
val wait_ = newTermName("wait")
val xml = newTermName("xml")
val zip = newTermName("zip")