From 0bfa3c42034354026fbff13518bc1bf14f4a26bb Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 4 Nov 2014 23:44:42 -0800 Subject: SI-5217 Companion privates in scope of class parms Test of the same. It progressed in 2.10.1. --- test/files/pos/t5217.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/files/pos/t5217.scala (limited to 'test') diff --git a/test/files/pos/t5217.scala b/test/files/pos/t5217.scala new file mode 100644 index 0000000000..1fe3f5696f --- /dev/null +++ b/test/files/pos/t5217.scala @@ -0,0 +1,17 @@ +// private types and terms of companion module are +// available in scope of ctor params. +// before 2.10.1, class B in object A cannot be accessed in object A +object A { + private class B + private val b: B = new B + private type C = Int + def apply(): A = new A() +} +// if not private, then default arg results in: +// private class B escapes its defining scope as part of type A.B +class A private (b: A.B = A.b, c: A.C = 42) + +object C { + private class B +} +class C(b: C.B) -- cgit v1.2.3