summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2014-11-05 16:50:16 +0100
committerLukas Rytz <lukas.rytz@typesafe.com>2014-11-05 16:50:16 +0100
commit954b57b45f16109b4e366397e19c6b6114a7a642 (patch)
treee3cd75f2c0d076a5a819b7d3cbbe6b6c4cdddd7f /test
parent90b9eea313420756fa90a33915333159094f345d (diff)
parent0bfa3c42034354026fbff13518bc1bf14f4a26bb (diff)
downloadscala-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')
-rw-r--r--test/files/pos/t5217.scala17
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)