aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-12 18:09:48 +0100
committerMartin Odersky <odersky@gmail.com>2017-03-12 18:09:56 +0100
commit32617344f90001faa65a020f54d309d076da8fcc (patch)
treed479c440deedd9b31a68999ef54d9d843ebc4893 /tests/neg
parentc878f8101173d27fe9640bea5d1cea704061ca3c (diff)
downloaddotty-32617344f90001faa65a020f54d309d076da8fcc.tar.gz
dotty-32617344f90001faa65a020f54d309d076da8fcc.tar.bz2
dotty-32617344f90001faa65a020f54d309d076da8fcc.zip
Alternative fix of #2066.
Now we never match `? { name: T }` with types that have only a private `name` member. This is what scalac does, too.
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/i2066.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/neg/i2066.scala b/tests/neg/i2066.scala
new file mode 100644
index 000000000..0081cec07
--- /dev/null
+++ b/tests/neg/i2066.scala
@@ -0,0 +1,27 @@
+class Foo
+
+object Test {
+ implicit def two(x: Foo): Two = new Two(x)
+
+ class Two(x: Foo) {
+ private def meth: Unit = {}
+
+ def test2(foo: Foo): Unit = {
+ foo.meth // error
+ }
+ }
+}
+
+
+object Test2 {
+
+ class Two(x: Foo) {
+ implicit def two(x: Foo): Two = new Two(x)
+
+ private def meth: Unit = {}
+
+ def test2(foo: Foo): Unit = {
+ foo.meth // error
+ }
+ }
+}