summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-11-26 23:12:56 -0800
committerJason Zaugg <jzaugg@gmail.com>2013-11-26 23:12:56 -0800
commita6f758202ada377888563d51915119a386dd6b3e (patch)
tree20102999a04107415382bd85b92ca3026b0741b5 /test/files/pos
parent33de562b3a224b2b9d7108ba0565c2f9ba57c526 (diff)
parent28bf4ada31119712b415b2b2f6aeb87f0431eb48 (diff)
downloadscala-a6f758202ada377888563d51915119a386dd6b3e.tar.gz
scala-a6f758202ada377888563d51915119a386dd6b3e.tar.bz2
scala-a6f758202ada377888563d51915119a386dd6b3e.zip
Merge pull request #3189 from retronym/ticket/8002
private access for local companions
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t8002-nested-scope.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t8002-nested-scope.scala b/test/files/pos/t8002-nested-scope.scala
new file mode 100644
index 0000000000..a2088bce7a
--- /dev/null
+++ b/test/files/pos/t8002-nested-scope.scala
@@ -0,0 +1,20 @@
+// This test serves to capture the status quo, but should really
+// emit an accessibiltiy error.
+
+// `Namers#companionSymbolOf` seems too lenient, and currently doesn't
+// implement the same-scope checks mentioned:
+//
+// https://github.com/scala/scala/pull/2816#issuecomment-22555206
+//
+class C {
+ def foo = {
+ class C { private def x = 0 }
+
+ {
+ val a = 0
+ object C {
+ new C().x
+ }
+ }
+ }
+}