diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-11-23 22:25:22 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-11-24 09:12:24 +0100 |
commit | 28bf4ada31119712b415b2b2f6aeb87f0431eb48 (patch) | |
tree | b4aad81d541a4fa1327b051c67f277554aa6aecc /src/compiler/scala/tools/nsc/typechecker/Contexts.scala | |
parent | c243435f113615b2f7407fbd683c93ec16c73749 (diff) | |
download | scala-28bf4ada31119712b415b2b2f6aeb87f0431eb48.tar.gz scala-28bf4ada31119712b415b2b2f6aeb87f0431eb48.tar.bz2 scala-28bf4ada31119712b415b2b2f6aeb87f0431eb48.zip |
SI-8002 private access for local companions
We go through similar gymnastics to make companion implicits
work for local class/object pairings, so we ought to be consistent
when it comes to access
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 5e5619d034..2be6d92ed0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -657,7 +657,10 @@ trait Contexts { self: Analyzer => // Console.println("isAccessible(%s, %s, %s)".format(sym, pre, superAccess)) // don't have access if there is no linked class (so exclude linkedClass=NoSymbol) - def accessWithinLinked(ab: Symbol) = ab.linkedClassOfClass.fold(false)(accessWithin) + def accessWithinLinked(ab: Symbol) = { + val linked = linkedClassOfClassOf(ab, this) + linked.fold(false)(accessWithin) + } /* Are we inside definition of `ab`? */ def accessWithin(ab: Symbol) = { |