diff options
Diffstat (limited to 'sources/scalac')
-rw-r--r-- | sources/scalac/transformer/AddConstructors.java | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/sources/scalac/transformer/AddConstructors.java b/sources/scalac/transformer/AddConstructors.java index 639328a222..4dd36b1cf2 100644 --- a/sources/scalac/transformer/AddConstructors.java +++ b/sources/scalac/transformer/AddConstructors.java @@ -158,27 +158,23 @@ public class AddConstructors extends Transformer { } // inline the call to the super constructor - if ( !forINT || !treeSym.parents()[0].symbol().isJava()) { - switch (impl.parents[0]) { - case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] args): - assert fun.symbol().isConstructor(): impl.parents[0]; - int pos = impl.parents[0].pos; - Tree superConstr = gen.Select - (gen.Super(pos, treeSym), fun.symbol()); - constrBody.add(gen.mkApplyTV(superConstr, targs, args)); - break; - case Apply(Tree fun, Tree[] args): - assert fun.symbol().isConstructor(): impl.parents[0]; - int pos = impl.parents[0].pos; - Tree superConstr = gen.Select - (gen.Super(pos, treeSym), fun.symbol()); - constrBody.add(gen.mkApply_V(superConstr, args)); - break; - default: - throw Debug.abort("illegal case", impl.parents[0]); - } - } else { - constrBody.add(gen.This(tree.pos, treeSym)); + switch (impl.parents[0]) { + case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] args): + assert fun.symbol().isConstructor(): impl.parents[0]; + int pos = impl.parents[0].pos; + Tree superConstr = gen.Select + (gen.Super(pos, treeSym), fun.symbol()); + constrBody.add(gen.mkApplyTV(superConstr, targs, args)); + break; + case Apply(Tree fun, Tree[] args): + assert fun.symbol().isConstructor(): impl.parents[0]; + int pos = impl.parents[0].pos; + Tree superConstr = gen.Select + (gen.Super(pos, treeSym), fun.symbol()); + constrBody.add(gen.mkApply_V(superConstr, args)); + break; + default: + throw Debug.abort("illegal case", impl.parents[0]); } // inline initialization of module values |