summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-08-21 17:18:33 +0000
committerMartin Odersky <odersky@gmail.com>2006-08-21 17:18:33 +0000
commit1536b1c67ecff52027a0c24d6791fb978fb88db4 (patch)
treeee544f3b5126e4393a2746d0b04281d413b1812e /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parent7f3d535727ff3fd8ba38e6fd55d474f76ed3ed90 (diff)
downloadscala-1536b1c67ecff52027a0c24d6791fb978fb88db4.tar.gz
scala-1536b1c67ecff52027a0c24d6791fb978fb88db4.tar.bz2
scala-1536b1c67ecff52027a0c24d6791fb978fb88db4.zip
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index b1a4b74133..27f3310c11 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -243,25 +243,22 @@ trait Contexts requires Analyzer {
/** Is `clazz' a subclass of an enclosing class? */
def isSubClassOfEnclosing(clazz: Symbol): boolean = {
var c = this.enclClass
- while (c != NoContext && !clazz.isSubClass(c.owner)) c = c.outer.enclClass
+ while (c != NoContext && !clazz.isNonBottomSubClass(c.owner)) c = c.outer.enclClass
c != NoContext
}
- ( pre == NoPrefix
- ||
- (!sym.hasFlag(PRIVATE | PROTECTED))
- ||
- (accessWithin(sym.owner) || accessWithin(sym.owner.linkedClassOfClass)) &&
- (!sym.hasFlag(LOCAL) || pre =:= sym.owner.thisType)
- ||
- (!sym.hasFlag(PRIVATE) &&
+ (pre == NoPrefix) || {
+ val ab = sym.accessBoundary(sym.owner)
+ ((ab == NoSymbol)
+ ||
+ (accessWithin(ab) || accessWithin(ab.linkedClassOfClass)) &&
+ (!sym.hasFlag(LOCAL) || pre =:= sym.owner.thisType)
+ ||
+ (sym hasFlag PROTECTED) &&
(superAccess ||
- (pre.widen.symbol.isSubClass(sym.owner) && isSubClassOfEnclosing(pre.widen.symbol))))
- ) && (
- sym.privateWithin == NoSymbol
- ||
- phase.erasedTypes || accessWithin(sym.privateWithin)
- )
+ (pre.widen.symbol.isNonBottomSubClass(sym.owner) &&
+ isSubClassOfEnclosing(pre.widen.symbol))))
+ }
}
def pushTypeBounds(sym: Symbol): unit = {