diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 974c0842d3..98ee4ad94d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -516,7 +516,7 @@ trait Contexts { self: Analyzer => argContext.scope enter e.sym } } - if (c.isLocal && !c.owner.isLocalDummy) { + if (c.owner.isTerm && !c.owner.isLocalDummy) { enterElems(c.outer) enterLocalElems(c.scope.elems) } @@ -589,9 +589,6 @@ trait Contexts { self: Analyzer => else if (bufferErrors) reportBuffer += (pos -> msg) } - /** Is the owning symbol of this context a term? */ - final def isLocal: Boolean = owner.isTerm - // nextOuter determines which context is searched next for implicits // (after `this`, which contributes `newImplicits` below.) In // most cases, it is simply the outer context: if we're owned by @@ -714,7 +711,7 @@ trait Contexts { self: Analyzer => ( (ab.isTerm || ab == rootMirror.RootClass) || (accessWithin(ab) || accessWithinLinked(ab)) && - ( !sym.hasLocalFlag + ( !sym.isLocalToThis || sym.owner.isImplClass // allow private local accesses to impl classes || sym.isProtected && isSubThisType(pre, sym.owner) || pre =:= sym.owner.thisType @@ -980,7 +977,7 @@ trait Contexts { self: Analyzer => // 2) sym.owner is inherited by the correct package object class // We try to establish 1) by inspecting the owners directly, and then we try // to rule out 2), and only if both those fail do we resort to looking in the info. - !sym.isPackage && sym.owner.exists && ( + !sym.hasPackageFlag && sym.owner.exists && ( if (sym.owner.isPackageObjectClass) sym.owner.owner == pkgClass else |