aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-11-16 22:34:39 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-11-22 01:35:08 +0100
commitd3a4916b4f04e89a6fd850206f92bbffa8cce14e (patch)
tree2ab2e2b002c1384b7a16a0d447f2600228f33c76 /compiler/src
parentce23380cbcec633cba63f19bc8f02c1d2b8048bb (diff)
downloaddotty-d3a4916b4f04e89a6fd850206f92bbffa8cce14e.tar.gz
dotty-d3a4916b4f04e89a6fd850206f92bbffa8cce14e.tar.bz2
dotty-d3a4916b4f04e89a6fd850206f92bbffa8cce14e.zip
checkNoPrivateLeaks: handle defs in local classes
The access boundary of a def in a local class is the owner of that class, previously it was set to the access boundary of the owner of the class instead.
Diffstat (limited to 'compiler/src')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Checking.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala
index c363ee81e..0c5a8e5db 100644
--- a/compiler/src/dotty/tools/dotc/typer/Checking.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -355,7 +355,7 @@ object Checking {
var errors: Errors = Nil
def accessBoundary(sym: Symbol): Symbol =
- if (sym.is(Private)) sym.owner
+ if (sym.is(Private) || !sym.owner.isClass) sym.owner
else if (sym.privateWithin.exists) sym.privateWithin
else if (sym.is(Package)) sym
else accessBoundary(sym.owner)