summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2006-02-16 08:30:24 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2006-02-16 08:30:24 +0000
commit4f6c6e57cb563ed56b59135ded4001ba62233cdd (patch)
tree951d4e183d8f139d6f36983abd3861eab7253a4d /src
parenta831beb5403f95d1b459b1cc42dd370d7d913564 (diff)
downloadscala-4f6c6e57cb563ed56b59135ded4001ba62233cdd.tar.gz
scala-4f6c6e57cb563ed56b59135ded4001ba62233cdd.tar.bz2
scala-4f6c6e57cb563ed56b59135ded4001ba62233cdd.zip
Fixed a bug in Codification.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Codification.scala14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Codification.scala b/src/compiler/scala/tools/nsc/typechecker/Codification.scala
index f6af067609..d9c345f5fb 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Codification.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Codification.scala
@@ -6,6 +6,7 @@
package scala.tools.nsc.typechecker;
import symtab.Flags._;
+import scala.collection.mutable.HashMap;
import scala.collection.immutable.ListMap;
import scala.collection.mutable.ListBuffer;
import scala.tools.nsc.util.FreshNameCreator;
@@ -16,14 +17,14 @@ mixin class Codification requires Analyzer {
case class FreeValue(tree: Tree) extends reflect.Code;
- class ReifyEnvironment extends ListMap[Symbol, reflect.Symbol] {
- var targets = ListMap.Empty[String, Option[reflect.LabelSymbol]]
+ class ReifyEnvironment extends HashMap[Symbol, reflect.Symbol] {
+ var targets = new HashMap[String, Option[reflect.LabelSymbol]]()
def addTarget(name: String, target: reflect.LabelSymbol): Unit =
- targets = targets.update(name, Some(target))
+ targets.update(name, Some(target))
def getTarget(name: String): Option[reflect.LabelSymbol] =
targets.get(name) match {
case None =>
- targets = targets.update(name, None)
+ targets.update(name, None)
None
case Some(None) => None
case Some(tgt) => tgt
@@ -33,7 +34,8 @@ mixin class Codification requires Analyzer {
case Some(_) => true
case None => false
}
- override def update(sym: Symbol, rsym: reflect.Symbol): ReifyEnvironment = this.update(sym,rsym)
+ override def update(sym: Symbol, rsym: reflect.Symbol) =
+ super.update(sym,rsym)
}
class Reifier(env: ReifyEnvironment, currentOwner: reflect.Symbol) {
@@ -65,7 +67,7 @@ mixin class Codification requires Analyzer {
for (val vparam <- vparams) {
val local = reflect.LocalValue(
currentOwner, vparam.symbol.name.toString(), reify(vparam.symbol.tpe));
- env1 = env1.update(vparam.symbol, local);
+ env1.update(vparam.symbol, local);
}
reflect.Function(vparams map (.symbol) map env1,
new Reifier(env1, currentOwner).reify(body))