From b6daa2a522e88cfb70776b66301b65ed6d0205f6 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 10 Mar 2016 11:30:34 +0100 Subject: Make sure lazy accessors in traits are not private. Fixes #1140. Review by @DarkDimius or @smarter. --- tests/run/i1140/A_1.scala | 4 ++++ tests/run/i1140/B_2.scala | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 tests/run/i1140/A_1.scala create mode 100644 tests/run/i1140/B_2.scala (limited to 'tests') diff --git a/tests/run/i1140/A_1.scala b/tests/run/i1140/A_1.scala new file mode 100644 index 000000000..e16a8162d --- /dev/null +++ b/tests/run/i1140/A_1.scala @@ -0,0 +1,4 @@ +trait A { + val foo = 0 + x + private lazy val x = 1 +} diff --git a/tests/run/i1140/B_2.scala b/tests/run/i1140/B_2.scala new file mode 100644 index 000000000..aa576c256 --- /dev/null +++ b/tests/run/i1140/B_2.scala @@ -0,0 +1,5 @@ +object Test extends A { + def main(args: Array[String]): Unit = { + assert(foo == 1) + } +} -- cgit v1.2.3