aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/leak-type.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/neg/leak-type.scala')
-rw-r--r--tests/neg/leak-type.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/neg/leak-type.scala b/tests/neg/leak-type.scala
new file mode 100644
index 000000000..30ecab70b
--- /dev/null
+++ b/tests/neg/leak-type.scala
@@ -0,0 +1,13 @@
+trait A {
+ private type Foo = Int
+
+
+ class Inner[T <: Foo] { // error: non-private type T refers to private type Foo in its type signature
+ def get: T = ???
+ }
+}
+class B extends A {
+ def foo(x: Inner[_]): Unit = {
+ val a = x.get // error: cannot resolve reference to type B(B.this).Foo
+ }
+}