diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-11-05 16:50:16 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-11-05 16:50:16 +0100 |
commit | 954b57b45f16109b4e366397e19c6b6114a7a642 (patch) | |
tree | e3cd75f2c0d076a5a819b7d3cbbe6b6c4cdddd7f /test/files | |
parent | 90b9eea313420756fa90a33915333159094f345d (diff) | |
parent | 0bfa3c42034354026fbff13518bc1bf14f4a26bb (diff) | |
download | scala-954b57b45f16109b4e366397e19c6b6114a7a642.tar.gz scala-954b57b45f16109b4e366397e19c6b6114a7a642.tar.bz2 scala-954b57b45f16109b4e366397e19c6b6114a7a642.zip |
Merge pull request #4092 from som-snytt/issue/5217
SI-5217 Companion privates in scope of class parms
Diffstat (limited to 'test/files')
-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) |