summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2005-12-01 10:24:46 +0000
committerIulian Dragos <jaguarul@gmail.com>2005-12-01 10:24:46 +0000
commitc2967e39e131679ba4d962f4c3ec6ea2c9d8d8a7 (patch)
tree05b7544a343ca1809384666d029ff03af309ed69
parentbbc77264aab2c6b0660d077ae5388b06fbc66236 (diff)
downloadscala-c2967e39e131679ba4d962f4c3ec6ea2c9d8d8a7.tar.gz
scala-c2967e39e131679ba4d962f4c3ec6ea2c9d8d8a7.tar.bz2
scala-c2967e39e131679ba4d962f4c3ec6ea2c9d8d8a7.zip
Fixed another bug in scanForLabels.
-rw-r--r--sources/scala/tools/nsc/backend/icode/GenICode.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/scala/tools/nsc/backend/icode/GenICode.scala b/sources/scala/tools/nsc/backend/icode/GenICode.scala
index bca00a6187..afc56ae051 100644
--- a/sources/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/sources/scala/tools/nsc/backend/icode/GenICode.scala
@@ -1106,8 +1106,10 @@ abstract class GenICode extends SubComponent {
override def traverse(tree: Tree): Unit = tree match {
case LabelDef(name, params, rhs) =>
- ctx.labels += tree.symbol -> (new Label(tree.symbol) setParams(params map (.symbol)));
- ctx.method.addLocals(params map (p => new Local(p.symbol, toTypeKind(p.symbol.info))));
+ if (!ctx.labels.contains(tree.symbol)) {
+ ctx.labels += tree.symbol -> (new Label(tree.symbol) setParams(params map (.symbol)));
+ ctx.method.addLocals(params map (p => new Local(p.symbol, toTypeKind(p.symbol.info))));
+ }
super.traverse(rhs);
case _ => super.traverse(tree);