diff options
author | paltherr <paltherr@epfl.ch> | 2003-10-31 12:03:01 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-10-31 12:03:01 +0000 |
commit | 8c3432973c2a9519bdf8e2e74cf7f8a942414871 (patch) | |
tree | 4eaf4fb3e33984ea06f463ce248c350d48ee3928 /sources/scalac | |
parent | 8ff5e6c0e540e1b186ffe7925490f2c3f2a34e74 (diff) | |
download | scala-8c3432973c2a9519bdf8e2e74cf7f8a942414871.tar.gz scala-8c3432973c2a9519bdf8e2e74cf7f8a942414871.tar.bz2 scala-8c3432973c2a9519bdf8e2e74cf7f8a942414871.zip |
- Changed the return type of initializers to Un...
- Changed the return type of initializers to Unit also for interpreter
Diffstat (limited to 'sources/scalac')
-rw-r--r-- | sources/scalac/transformer/AddConstructors.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sources/scalac/transformer/AddConstructors.java b/sources/scalac/transformer/AddConstructors.java index bc00cfd709..639328a222 100644 --- a/sources/scalac/transformer/AddConstructors.java +++ b/sources/scalac/transformer/AddConstructors.java @@ -84,8 +84,7 @@ public class AddConstructors extends Transformer { new TermSymbol(classConstr.pos, classConstr.name, owner, flags); Type constrType = Type.MethodType - (paramSyms, forINT ? owner.type() - : global.definitions.UNIT_TYPE()); + (paramSyms, global.definitions.UNIT_TYPE()); if (tparamSyms.length != 0) constrType = Type.PolyType(tparamSyms, constrType); @@ -234,10 +233,7 @@ public class AddConstructors extends Transformer { rhs = transform(rhs); subst.removeSymbol(constr.valueParams()); subst.removeSymbol(constr.typeParams()); - Tree result = forINT - ? gen.This(rhs.pos, constr.constructorClass()) - : gen.mkUnitLit(rhs.pos); - rhs = gen.mkBlock(new Tree[] { rhs, result }); + rhs = gen.mkBlock(new Tree[] { rhs, gen.mkUnitLit(rhs.pos) }); return gen.DefDef(init, rhs); // Substitute the constructor into the 'new' expressions |