summaryrefslogtreecommitdiff
path: root/sources/scalac/transformer/UnCurry.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-12-19 18:57:21 +0000
committerpaltherr <paltherr@epfl.ch>2003-12-19 18:57:21 +0000
commitf22dc6124da3463c0264bf5f2d2cc9a950928e64 (patch)
treed9a89bb10c7ae27aa50d5a43cf6716a454257f1f /sources/scalac/transformer/UnCurry.java
parent77eea4abf2d2870623493dabc7f7abf6b6ddbb9f (diff)
downloadscala-f22dc6124da3463c0264bf5f2d2cc9a950928e64.tar.gz
scala-f22dc6124da3463c0264bf5f2d2cc9a950928e64.tar.bz2
scala-f22dc6124da3463c0264bf5f2d2cc9a950928e64.zip
- Added method isUnaccessedConstant
- Added removal of unaccessed constants from class scopes
Diffstat (limited to 'sources/scalac/transformer/UnCurry.java')
-rw-r--r--sources/scalac/transformer/UnCurry.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/sources/scalac/transformer/UnCurry.java b/sources/scalac/transformer/UnCurry.java
index 833ca96eda..f806d74045 100644
--- a/sources/scalac/transformer/UnCurry.java
+++ b/sources/scalac/transformer/UnCurry.java
@@ -125,23 +125,16 @@ public class UnCurry extends OwnerTransformer
case DefDef(_, _, AbsTypeDef[] tparams, ValDef[][] vparams, Tree tpe, Tree rhs):
Symbol sym = tree.symbol();
- if ((sym.flags & ACCESSED) == 0) {
- switch (sym.type()) {
- case PolyType(Symbol[] tparams1, ConstantType(_, _)):
- if (tparams1.length == 0) return gen.mkUnitLit(tree.pos);
- }
- }
+ if (descr.isUnaccessedConstant(sym))
+ return gen.mkUnitLit(tree.pos);
Tree rhs1 = transform(rhs, sym);
return copy.DefDef(
tree, sym, tparams, uncurry(transform(vparams, sym)), tpe, rhs1);
case ValDef(_, _, Tree tpe, Tree rhs):
Symbol sym = tree.symbol();
- if ((sym.flags & ACCESSED) == 0) {
- switch (sym.type()) {
- case ConstantType(_, _): return gen.mkUnitLit(tree.pos);
- }
- }
+ if (descr.isUnaccessedConstant(sym))
+ return gen.mkUnitLit(tree.pos);
if (sym.isDefParameter()) {
Type newtype = global.definitions.FUNCTION_TYPE(Type.EMPTY_ARRAY, tpe.type);
Tree tpe1 = gen.mkType(tpe.pos, newtype);