summaryrefslogtreecommitdiff
path: root/test/files/pos/trait_lazy_accessboundary.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2016-08-19 20:01:38 -0700
committerAdriaan Moors <adriaan@lightbend.com>2016-08-29 09:54:08 +0200
commit6f7bd990ae69d6796c68894133c1975bef354e12 (patch)
treea88ac77e03434634353dee318e4648a4f6a90ce4 /test/files/pos/trait_lazy_accessboundary.scala
parent0f813a5675f7f6c45acfab705b697e9cc1eceff3 (diff)
downloadscala-6f7bd990ae69d6796c68894133c1975bef354e12.tar.gz
scala-6f7bd990ae69d6796c68894133c1975bef354e12.tar.bz2
scala-6f7bd990ae69d6796c68894133c1975bef354e12.zip
Ensure access from subclass to trait lazy val
Since we need to refer to a trait lazy val's accessor using a super call in a subclass (when the field and bitmap are added), we must ensure that access is allowed. If the lazy val has an access boundary (e.g., `private[somePkg]`), make sure the `PROTECTED` flag is set, which widens access to `protected[somePkg]`. (As `member.hasAccessBoundary` implies `!member.hasFlag(PRIVATE)`, we don't have to `resetFlag PRIVATE`.)
Diffstat (limited to 'test/files/pos/trait_lazy_accessboundary.scala')
-rw-r--r--test/files/pos/trait_lazy_accessboundary.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/files/pos/trait_lazy_accessboundary.scala b/test/files/pos/trait_lazy_accessboundary.scala
new file mode 100644
index 0000000000..6529816ffb
--- /dev/null
+++ b/test/files/pos/trait_lazy_accessboundary.scala
@@ -0,0 +1,2 @@
+package foo { trait HasLazy { private[foo] lazy val myLazy = "my lady" } }
+package bar { class MixInSuperLazy extends foo.HasLazy }