diff options
author | Martin Odersky <odersky@gmail.com> | 2006-09-04 13:07:47 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-09-04 13:07:47 +0000 |
commit | 7936eb95ccfaf88fda3a31505f1d5df42ab466af (patch) | |
tree | 50298b03fcfcd933616d376e15d829536f78859b /src | |
parent | 423649a208e8efe247c10eda71a4dc655be37bab (diff) | |
download | scala-7936eb95ccfaf88fda3a31505f1d5df42ab466af.tar.gz scala-7936eb95ccfaf88fda3a31505f1d5df42ab466af.tar.bz2 scala-7936eb95ccfaf88fda3a31505f1d5df42ab466af.zip |
fixed gilles problem with spurious recursive types
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/AddInterfaces.scala | 13 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index b75dedbda7..e84b845973 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -622,10 +622,10 @@ trait Symbols requires SymbolTable { * package as this class. */ final def linkedModuleOfClass: Symbol = - if (this != NoSymbol) - owner.info.decl(name.toTermName).suchThat( + if (this.isClass && !this.isAnonymousClass && !this.isRefinementClass) { + owner.rawInfo.decl(name.toTermName).suchThat( sym => (sym hasFlag MODULE) && (sym.rawInfo ne NoType)) - else NoSymbol + } else NoSymbol /** For a module its linked class, for a class its linked module or case factory otherwise */ final def linkedSym: Symbol = @@ -641,7 +641,7 @@ trait Symbols requires SymbolTable { final def toInterface: Symbol = if (isImplClass) { val result = - if (phase.erasedTypes || phase.name == "erasure") { + if (phase.next.erasedTypes) { assert(!tpe.parents.isEmpty, this) tpe.parents.last.symbol } else { diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala index 19319079e0..9e9f06fc5d 100644 --- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala +++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala @@ -69,7 +69,7 @@ abstract class AddInterfaces extends InfoTransform { val e = decls.lookupEntry(impl.name) if (e == null) { decls enter impl - } else if (true || currentRun.compiles(iface)) { + } else { decls.unlink(e) decls enter impl } @@ -86,7 +86,16 @@ abstract class AddInterfaces extends InfoTransform { } } - /** A lazy type to set the info of an implementation class */ + /** A lazy type to set the info of an implementation class + * The parents of an implementation class for trait `iface' are: + * - superclass: Object + * - mixin classes: mixin classes of `iface' where every non-interface trait + * is mapped to its implementation class, followed by + * `iface' itself. + * The declarations of a mixin class are + * - for every interface member of `iface' its implemention method, if one is needed. + * - every former member of `iface' that is implementation only + */ private class LazyImplClassType(iface: Symbol) extends LazyType { /** Compute the decls of implementation class `implClass', |