diff options
author | paltherr <paltherr@epfl.ch> | 2004-06-17 09:13:01 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-06-17 09:13:01 +0000 |
commit | 5e263118d033335599cbe946f84fdf9578159750 (patch) | |
tree | 22e32f3c8f73ff98efcdb43728b1586d6f2ca7b6 /sources/scalac | |
parent | b64f685febe056c5d90c6bb1589edf0a7f09254a (diff) | |
download | scala-5e263118d033335599cbe946f84fdf9578159750.tar.gz scala-5e263118d033335599cbe946f84fdf9578159750.tar.bz2 scala-5e263118d033335599cbe946f84fdf9578159750.zip |
- Added static members of superclasses to stati...
- Added static members of superclasses to static part of subclasses
Diffstat (limited to 'sources/scalac')
-rw-r--r-- | sources/scalac/symtab/classfile/ClassfileParser.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sources/scalac/symtab/classfile/ClassfileParser.java b/sources/scalac/symtab/classfile/ClassfileParser.java index 73432a945f..5220e7d69a 100644 --- a/sources/scalac/symtab/classfile/ClassfileParser.java +++ b/sources/scalac/symtab/classfile/ClassfileParser.java @@ -13,6 +13,7 @@ import scala.tools.util.Position; import scalac.*; import scalac.util.*; import scalac.symtab.*; +import scalac.symtab.Scope.SymbolIterator; import java.io.*; import java.util.*; @@ -142,6 +143,32 @@ public class ClassfileParser implements ClassfileConstants { //System.out.println("statics class: " + staticsClass); //System.out.println("module: " + m); //System.out.println("modules class: " + m.type().symbol()); + + // Add static members of superclass + Symbol superclass = supertpe.symbol(); + if (m.isJava() && superclass.isJava()) { + Symbol mclass = m.moduleClass(); + SymbolIterator i = superclass.linkedModule().moduleClass() + .members().iterator(true); + outer: + while (i.hasNext()) { + Symbol member = i.next(); + Symbol current = statics.lookup(member.name); + if (!current.isNone()) { + if (!member.isTerm()) continue outer; + Type info = member.info(); + Symbol[] currents = current.alternativeSymbols(); + inner: + for (int j = 0; j < currents.length; j++) { + if (currents[j].owner() != mclass) + continue inner; + if (currents[j].info().isSubType(info)) + continue outer; + } + } + statics.enterOrOverload(member); + } + } } } |