summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-12-11 18:13:15 +0000
committerpaltherr <paltherr@epfl.ch>2003-12-11 18:13:15 +0000
commit933984df2ca3e4017993bb80f340fed8ad3664d1 (patch)
tree228ca55027915a5ee6d9b09fa57b5f1f77c1e377 /sources
parentbcc3423f85334e1d69d60eb1164d79555f373562 (diff)
downloadscala-933984df2ca3e4017993bb80f340fed8ad3664d1.tar.gz
scala-933984df2ca3e4017993bb80f340fed8ad3664d1.tar.bz2
scala-933984df2ca3e4017993bb80f340fed8ad3664d1.zip
- Removed field other from ACode.Switch
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/atree/ACode.java2
-rw-r--r--sources/scalac/atree/ATreeFactory.java6
-rw-r--r--sources/scalac/atree/ATreePrinter.java4
-rw-r--r--sources/scalac/atree/ATreeTyper.java7
4 files changed, 7 insertions, 12 deletions
diff --git a/sources/scalac/atree/ACode.java b/sources/scalac/atree/ACode.java
index d9b1c1ab9d..609bb03dea 100644
--- a/sources/scalac/atree/ACode.java
+++ b/sources/scalac/atree/ACode.java
@@ -48,7 +48,7 @@ public class ACode {
public case If(ACode test, ACode success, ACode failure);
// jvm : {tables, lookup}switch
- public case Switch(ACode test, int[][] tags, ACode[] bodies, ACode other);
+ public case Switch(ACode test, int[][] tags, ACode[] bodies);
// jvm : monitor{enter, exit}
public case Synchronized(ACode lock, ACode value);
diff --git a/sources/scalac/atree/ATreeFactory.java b/sources/scalac/atree/ATreeFactory.java
index be6d0e563a..422c3376c6 100644
--- a/sources/scalac/atree/ATreeFactory.java
+++ b/sources/scalac/atree/ATreeFactory.java
@@ -83,10 +83,8 @@ public class ATreeFactory {
}
/** Builds a Switch node. */
- public ACode Switch(Tree t, ACode test, int[][] tags, ACode[] bodies,
- ACode other)
- {
- ACode.Switch code = ACode.Switch(test, tags, bodies, other);
+ public ACode Switch(Tree t, ACode test, int[][] tags, ACode[] bodies) {
+ ACode.Switch code = ACode.Switch(test, tags, bodies);
code.pos = t.pos;
return code;
}
diff --git a/sources/scalac/atree/ATreePrinter.java b/sources/scalac/atree/ATreePrinter.java
index 6e83b4ae36..620568e8d3 100644
--- a/sources/scalac/atree/ATreePrinter.java
+++ b/sources/scalac/atree/ATreePrinter.java
@@ -385,7 +385,7 @@ public class ATreePrinter {
rbrace().space().print("else").space().lbrace();
printCode(failure).line();
return rbrace();
- case Switch(ACode test, int[][] tags, ACode[] bodies, ACode other):
+ case Switch(ACode test, int[][] tags, ACode[] bodies):
print("switch").space().print('(').printCode(test).print(')');
lbrace();
for (int i = 0; i < tags.length; i++) {
@@ -394,7 +394,7 @@ public class ATreePrinter {
indent().printCode(bodies[i]).undent().line();
}
print("case").space().print('_').print(':').line();
- indent().printCode(other).undent();
+ indent().printCode(bodies[tags.length]).undent();
return rbrace();
case Synchronized(ACode lock, ACode value):
print("synchronized").space();
diff --git a/sources/scalac/atree/ATreeTyper.java b/sources/scalac/atree/ATreeTyper.java
index 3679740d41..3a1a1df5c7 100644
--- a/sources/scalac/atree/ATreeTyper.java
+++ b/sources/scalac/atree/ATreeTyper.java
@@ -65,11 +65,8 @@ public class ATreeTyper {
return cast ? type : definitions.BOOLEAN_TYPE();
case If(_, ACode success, ACode failure):
return Type.lub(new Type[]{type(success), type(failure)});
- case Switch(_, _, ACode[] bodies, ACode other):
- Type[] types = new Type[bodies.length + 1];
- for (int i = 0; i < bodies.length; i++) types[i] = type(bodies[i]);
- types[bodies.length] = type(other);
- return Type.lub(types);
+ case Switch(_, _, ACode[] bodies):
+ return Type.lub(type(bodies));
case Synchronized(_, ACode value):
return type(value);
case Block(_, _, ACode value):