diff options
Diffstat (limited to 'src/interactive/scala/tools/nsc/interactive/Global.scala')
-rw-r--r-- | src/interactive/scala/tools/nsc/interactive/Global.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala index 467a210cab..92c69dfcde 100644 --- a/src/interactive/scala/tools/nsc/interactive/Global.scala +++ b/src/interactive/scala/tools/nsc/interactive/Global.scala @@ -1018,7 +1018,11 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "") val enclosing = new Members[ScopeMember] def addScopeMember(sym: Symbol, pre: Type, viaImport: Tree) = locals.add(sym, pre, implicitlyAdded = false) { (s, st) => - new ScopeMember(s, st, context.isAccessible(s, pre, superAccess = false), viaImport) + // imported val and var are always marked as inaccessible, but they could be accessed through their getters. SI-7995 + if (s.hasGetter) + new ScopeMember(s, st, context.isAccessible(s.getter, pre, superAccess = false), viaImport) + else + new ScopeMember(s, st, context.isAccessible(s, pre, superAccess = false), viaImport) } def localsToEnclosing() = { enclosing.addNonShadowed(locals) |