diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-11-04 23:44:42 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-11-04 23:44:42 -0800 |
commit | 0bfa3c42034354026fbff13518bc1bf14f4a26bb (patch) | |
tree | e1894e3d1e5c89f841ceb4ea53914bfabd07ac27 | |
parent | bdae51d6a8f18a5456a32c350cb551d42a3cb6c6 (diff) | |
download | scala-0bfa3c42034354026fbff13518bc1bf14f4a26bb.tar.gz scala-0bfa3c42034354026fbff13518bc1bf14f4a26bb.tar.bz2 scala-0bfa3c42034354026fbff13518bc1bf14f4a26bb.zip |
SI-5217 Companion privates in scope of class parms
Test of the same. It progressed in 2.10.1.
-rw-r--r-- | test/files/pos/t5217.scala | 17 |
1 files changed, 17 insertions, 0 deletions
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) |