summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-12-19 22:03:59 +0000
committerpaltherr <paltherr@epfl.ch>2003-12-19 22:03:59 +0000
commit3d2b827dcc7ff027b1fad4bc39ea7ef1f9539769 (patch)
treea6c45bd7669f7fc248741a56a1e3750da388cdb7 /sources
parent2eed730f5fa149b88b00b7559959d6ae82acd519 (diff)
downloadscala-3d2b827dcc7ff027b1fad4bc39ea7ef1f9539769.tar.gz
scala-3d2b827dcc7ff027b1fad4bc39ea7ef1f9539769.tar.bz2
scala-3d2b827dcc7ff027b1fad4bc39ea7ef1f9539769.zip
- Changed to add calls to all super initializer...
- Changed to add calls to all super initializer (also mixin initializers)
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/transformer/AddConstructors.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/sources/scalac/transformer/AddConstructors.java b/sources/scalac/transformer/AddConstructors.java
index ca406bced9..75899b2316 100644
--- a/sources/scalac/transformer/AddConstructors.java
+++ b/sources/scalac/transformer/AddConstructors.java
@@ -170,23 +170,27 @@ public class AddConstructors extends GenTransformer {
}
// inline the call to the super constructor
- switch (impl.parents[0]) {
+ for (int i = 0; i < impl.parents.length; i++) {
+ switch (impl.parents[i]) {
case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] args):
- assert fun.symbol().isConstructor(): impl.parents[0];
- int pos = impl.parents[0].pos;
+ assert fun.symbol().isConstructor(): impl.parents[i];
+ if (fun.symbol().constructorClass().isInterface()) continue;
+ int pos = impl.parents[i].pos;
Tree superConstr = gen.Select
(gen.Super(pos, treeSym), getInitializer(fun.symbol()));
constrBody.add(gen.mkApply_V(superConstr, args));
break;
case Apply(Tree fun, Tree[] args):
- assert fun.symbol().isConstructor(): impl.parents[0];
- int pos = impl.parents[0].pos;
+ assert fun.symbol().isConstructor(): impl.parents[i];
+ if (fun.symbol().constructorClass().isInterface()) continue;
+ int pos = impl.parents[i].pos;
Tree superConstr = gen.Select
(gen.Super(pos, treeSym), getInitializer(fun.symbol()));
constrBody.add(gen.mkApply_V(superConstr, args));
break;
default:
- throw Debug.abort("illegal case", impl.parents[0]);
+ throw Debug.abort("illegal case", impl.parents[i]);
+ }
}
// inline initialization of module values