From 4a22b918ff938b7c627647e4ed5e74f539e62baa Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 6 Nov 2014 16:36:05 +1000 Subject: SI-7019 Fix crasher with private[this] extension methods When we move the body of value class methods to the corresponding extension method, we typecheck a forward method that remains in the class. In order to allow access, this commit weakens the access of `private[local]` extension methods to `private`. --- test/files/run/t7019.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/files/run/t7019.scala (limited to 'test') diff --git a/test/files/run/t7019.scala b/test/files/run/t7019.scala new file mode 100644 index 0000000000..5dcc09d2b6 --- /dev/null +++ b/test/files/run/t7019.scala @@ -0,0 +1,10 @@ +final class Foo(val i: Int) extends AnyVal { + def foo() = go(i) + private[this] def go(i: Int) = i * 2 +} + +object Test { + def main(args: Array[String]): Unit = { + assert(new Foo(1).foo() == 2) + } +} -- cgit v1.2.3