diff options
author | Martin Odersky <odersky@gmail.com> | 2006-12-01 15:47:29 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-12-01 15:47:29 +0000 |
commit | 9924a48040753103f6f88ef120c322ce1ae1a4fe (patch) | |
tree | 2b3c31001e5d4630eb5dd723d1b6860d4969ac27 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala | |
parent | e7b359918653a3eb8e45a5556ea0e49da69443f3 (diff) | |
download | scala-9924a48040753103f6f88ef120c322ce1ae1a4fe.tar.gz scala-9924a48040753103f6f88ef120c322ce1ae1a4fe.tar.bz2 scala-9924a48040753103f6f88ef120c322ce1ae1a4fe.zip |
fixed problem with protected
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 5ae728448b..2e4742e94c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -294,14 +294,13 @@ trait Contexts requires Analyzer { " " + scope.toList + "\n:: " + outer.toString() } - private def moduleToLinkedClass(sym: Symbol) = - if (sym.isModuleClass) sym.linkedClassOfModule else sym - /** Return closest enclosing context that defines a superclass of `clazz', or a * companion module of a superclass of `clazz', or NoContext if none exists */ def enclosingSuperClassContext(clazz: Symbol): Context = { var c = this.enclClass - while (c != NoContext && !clazz.isNonBottomSubClass(moduleToLinkedClass(c.owner))) + while (c != NoContext && + !clazz.isNonBottomSubClass(c.owner) && + !(c.owner.isModuleClass && clazz.isNonBottomSubClass(c.owner.linkedClassOfModule))) c = c.outer.enclClass c } |