aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2016-02-19 18:09:31 +0100
committerodersky <odersky@gmail.com>2016-02-19 18:09:31 +0100
commitdfa3ec849ff62f682092c450129e78d43829bde3 (patch)
treef6b812c0ae5995740bff6c04f0995b23db45d4dc /tests
parent2217a4ec9ea563f01b07c852a3834d738cd6439d (diff)
parent6f382a51a522673de75d154da2632108e7a1016c (diff)
downloaddotty-dfa3ec849ff62f682092c450129e78d43829bde3.tar.gz
dotty-dfa3ec849ff62f682092c450129e78d43829bde3.tar.bz2
dotty-dfa3ec849ff62f682092c450129e78d43829bde3.zip
Merge pull request #1066 from dotty-staging/fix-#997
Fix #997
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/i997.scala47
-rw-r--r--tests/neg/i997a.scala19
2 files changed, 66 insertions, 0 deletions
diff --git a/tests/neg/i997.scala b/tests/neg/i997.scala
new file mode 100644
index 000000000..8a21661fb
--- /dev/null
+++ b/tests/neg/i997.scala
@@ -0,0 +1,47 @@
+class C {
+
+ private type T = E
+ private type Tok = D
+ private val p: C = new C
+
+ def f1(x: T): Unit = () // error
+ def f1(x: Tok): Unit = () // ok
+ def f2(x: p.D): Unit = () // error
+
+ val v1: T = ??? // error
+ val v2: p.D = ??? // error
+
+ type U1[X <: T] // error
+ type U2 = T // error
+
+ private class E {
+ def f1ok(x: T): Unit = () // ok
+ def f2ok(x: p.D): Unit = () // ok
+
+ val v1ok: T = ??? // ok
+ val v2ok: p.D = ??? // ok
+
+ type U1ok[X <: T] //ok
+ type U2ok = T //ok
+ }
+
+ class D extends E { // error
+ def f1(x: T): Unit = () // error
+ def f2(x: p.D): Unit = () // error
+
+ val v1: T = ??? // error
+ val v2: p.D = ??? // error
+
+ type U1[X <: T] // error
+ type U2 = T // error
+ }
+
+ class F(x: T) // error
+
+ class G private (x: T) // ok
+
+ private trait U
+
+ class H extends U // error
+
+}
diff --git a/tests/neg/i997a.scala b/tests/neg/i997a.scala
new file mode 100644
index 000000000..eae56400f
--- /dev/null
+++ b/tests/neg/i997a.scala
@@ -0,0 +1,19 @@
+class C {
+
+ class Super
+
+ object O {
+
+ private case class CC(x: Int)
+
+ private implicit class D(x: Int) extends Super
+ }
+
+ import O._
+
+ println(O.CC(1)) // error: CC cannot be accessed
+
+ val s: Super = 1 // error: type mismatch
+
+
+}