diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-11-16 22:34:39 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-11-22 01:35:08 +0100 |
commit | d3a4916b4f04e89a6fd850206f92bbffa8cce14e (patch) | |
tree | 2ab2e2b002c1384b7a16a0d447f2600228f33c76 /tests/pos | |
parent | ce23380cbcec633cba63f19bc8f02c1d2b8048bb (diff) | |
download | dotty-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 'tests/pos')
-rw-r--r-- | tests/pos/leaks.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pos/leaks.scala b/tests/pos/leaks.scala index dbb47d75a..3fe029c75 100644 --- a/tests/pos/leaks.scala +++ b/tests/pos/leaks.scala @@ -15,3 +15,13 @@ class Outer2 { def foo: Outer2.x.type = Outer2.x // OK } } + +class Outer3 { + private val x: Int = 1 + + def meth: Unit = { + class Inner { + def foo: x.type = x // OK + } + } +} |