summaryrefslogtreecommitdiff
path: root/sources/scalac/transformer/AddInterfacesPhase.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-11-11 15:22:14 +0000
committerpaltherr <paltherr@epfl.ch>2003-11-11 15:22:14 +0000
commit83d1bae3f6418c09b2a899e056383b6d60284b87 (patch)
tree867f6ff0d395878a640cd85d14e371e1a6d5c37a /sources/scalac/transformer/AddInterfacesPhase.java
parent8dcce18a84d4c9003ec8eec5edfbcdd89119e25a (diff)
downloadscala-83d1bae3f6418c09b2a899e056383b6d60284b87.tar.gz
scala-83d1bae3f6418c09b2a899e056383b6d60284b87.tar.bz2
scala-83d1bae3f6418c09b2a899e056383b6d60284b87.zip
- Moved erasure of superclasses of interfaces f...
- Moved erasure of superclasses of interfaces from AddInterfaces into Erasure
Diffstat (limited to 'sources/scalac/transformer/AddInterfacesPhase.java')
-rw-r--r--sources/scalac/transformer/AddInterfacesPhase.java23
1 files changed, 7 insertions, 16 deletions
diff --git a/sources/scalac/transformer/AddInterfacesPhase.java b/sources/scalac/transformer/AddInterfacesPhase.java
index fec5d87a80..2536a4bc1d 100644
--- a/sources/scalac/transformer/AddInterfacesPhase.java
+++ b/sources/scalac/transformer/AddInterfacesPhase.java
@@ -40,7 +40,8 @@ public class AddInterfacesPhase extends Phase {
// removed.
return removeValueParams(tp);
} else if (sym.isClass() && !sym.isJava()) {
- Definitions definitions = Global.instance.definitions;
+ Definitions definitions = global.definitions;
+ if (sym == definitions.ANY_CLASS) return tp;
Type[] oldParents = tp.parents();
assert oldParents.length > 0 : Debug.show(sym);
for (int i = 1; i < oldParents.length; ++i) {
@@ -81,17 +82,7 @@ public class AddInterfacesPhase extends Phase {
newMembers.enterOrOverload(member);
}
- Symbol oldSym = oldParents[0].symbol();
- if (oldSym.isJava()
- && !oldSym.isInterface()
- && oldSym != definitions.ANY_CLASS
- && oldSym != definitions.ANYREF_CLASS) {
- newParents = new Type[oldParents.length];
- newParents[0] = definitions.ANYREF_TYPE();
- for (int i = 1; i < oldParents.length; ++i)
- newParents[i] = oldParents[i];
- } else
- newParents = oldParents;
+ newParents = oldParents;
} else {
// The symbol is the one of a class which doesn't need
// an interface. We need to fix its parents to use
@@ -161,10 +152,10 @@ public class AddInterfacesPhase extends Phase {
|| classSym.isModuleClass()
|| classSym.isAnonymousClass()
|| hasInterfaceSymbol(classSym)
- || classSym == Global.instance.definitions.ANY_CLASS
- || classSym == Global.instance.definitions.ANYREF_CLASS
- || classSym == Global.instance.definitions.ALL_CLASS
- || classSym == Global.instance.definitions.ALLREF_CLASS);
+ || classSym == global.definitions.ANY_CLASS
+ || classSym == global.definitions.ANYREF_CLASS
+ || classSym == global.definitions.ALL_CLASS
+ || classSym == global.definitions.ALLREF_CLASS);
}
protected final static String CLASS_SUFFIX = "$class";