summaryrefslogtreecommitdiff
path: root/sources/scalac/transformer/LambdaLift.java
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-08-14 18:36:02 +0000
committerMartin Odersky <odersky@gmail.com>2003-08-14 18:36:02 +0000
commitdf43fa3f64f2bff8321246684e731243b0fe93ea (patch)
treeab5d83cce3ad2c22f213cb60dac4e47f3d842d8f /sources/scalac/transformer/LambdaLift.java
parentf92d38c415f89214dfea5e86f79e091b2c573551 (diff)
downloadscala-df43fa3f64f2bff8321246684e731243b0fe93ea.tar.gz
scala-df43fa3f64f2bff8321246684e731243b0fe93ea.tar.bz2
scala-df43fa3f64f2bff8321246684e731243b0fe93ea.zip
*** empty log message ***
Diffstat (limited to 'sources/scalac/transformer/LambdaLift.java')
-rw-r--r--sources/scalac/transformer/LambdaLift.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/sources/scalac/transformer/LambdaLift.java b/sources/scalac/transformer/LambdaLift.java
index 6193af3fa3..8651abb0c7 100644
--- a/sources/scalac/transformer/LambdaLift.java
+++ b/sources/scalac/transformer/LambdaLift.java
@@ -209,15 +209,24 @@ public class LambdaLift extends OwnerTransformer
}
return super.transform(tree);
- case TypeDef(int mods, Name name, Tree rhs, Tree lobound):
+ case AbsTypeDef(int mods, Name name, Tree rhs, Tree lobound):
// ignore type definition as owner.
// reason: it might be in a refinement
// todo: handle type parameters?
- return copy.TypeDef(
+ return copy.AbsTypeDef(
tree, sym,
transform(rhs, currentOwner),
transform(lobound, currentOwner));
+ case AliasTypeDef(int mods, Name name, AbsTypeDef[] tparams, Tree rhs):
+ // ignore type definition as owner.
+ // reason: it might be in a refinement
+ // todo: handle type parameters?
+ return copy.AliasTypeDef(
+ tree, sym,
+ transform(tparams, currentOwner),
+ transform(rhs, currentOwner));
+
case Ident(_):
if (sym.isLocal()) {
if (sym.isMethod()) {
@@ -321,7 +330,7 @@ public class LambdaLift extends OwnerTransformer
liftSymbol(stats[i]);
return copy.Block(tree, transform(stats));
- case ClassDef(int mods, _, TypeDef[] tparams, ValDef[][] vparams, Tree tpe, Template impl):
+ case ClassDef(int mods, _, AbsTypeDef[] tparams, ValDef[][] vparams, Tree tpe, Template impl):
Symbol sym = tree.symbol();
if ((mods & LIFTED) != 0) {
((ClassDef) tree).mods &= ~LIFTED;
@@ -344,7 +353,7 @@ public class LambdaLift extends OwnerTransformer
transform(impl, sym));
}
- case DefDef(int mods, _, TypeDef[] tparams, ValDef[][] vparams, Tree tpe, Tree rhs):
+ case DefDef(int mods, _, AbsTypeDef[] tparams, ValDef[][] vparams, Tree tpe, Tree rhs):
Symbol sym = tree.symbol();
if ((mods & LIFTED) != 0) {
((DefDef) tree).mods &= ~LIFTED;
@@ -365,15 +374,24 @@ public class LambdaLift extends OwnerTransformer
transform(rhs, sym));
}
- case TypeDef(int mods, Name name, Tree rhs, Tree lobound):
+ case AbsTypeDef(int mods, Name name, Tree rhs, Tree lobound):
// ignore type definition as owner.
// reason: it might be in a refinement
// todo: handle type parameters?
- return copy.TypeDef(
+ return copy.AbsTypeDef(
tree, tree.symbol(),
transform(rhs, currentOwner),
transform(lobound, currentOwner));
+ case AliasTypeDef(int mods, Name name, AbsTypeDef[] tparams, Tree rhs):
+ // ignore type definition as owner.
+ // reason: it might be in a refinement
+ // todo: handle type parameters?
+ return copy.AliasTypeDef(
+ tree, tree.symbol(),
+ transform(tparams, currentOwner),
+ transform(rhs, currentOwner));
+
case ValDef(_, _, Tree tpe, Tree rhs):
Symbol sym = tree.symbol();
Tree tpe1 = transform(tpe);
@@ -587,9 +605,9 @@ public class LambdaLift extends OwnerTransformer
}
}
- TypeDef[] addTypeParams(TypeDef[] tparams, Symbol[] newtparams) {
+ AbsTypeDef[] addTypeParams(AbsTypeDef[] tparams, Symbol[] newtparams) {
if (newtparams.length == 0) return tparams;
- TypeDef[] tparams1 = new TypeDef[tparams.length + newtparams.length];
+ AbsTypeDef[] tparams1 = new AbsTypeDef[tparams.length + newtparams.length];
System.arraycopy(tparams, 0, tparams1, 0, tparams.length);
for (int i = 0; i < newtparams.length; i++) {
tparams1[tparams.length + i] = gen.mkTypeParam(newtparams[i]);