summaryrefslogtreecommitdiff
path: root/test/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-06-04 14:53:23 +0000
committerMartin Odersky <odersky@gmail.com>2003-06-04 14:53:23 +0000
commit3a593c580c9a23b3654ea3391fb22afa85db0697 (patch)
tree193a2614a7a55cd4e5304a22e7761c88ba23f6e6 /test/neg
parent6af6dae0df106de569e9b9cf503b3350722e58eb (diff)
downloadscala-3a593c580c9a23b3654ea3391fb22afa85db0697.tar.gz
scala-3a593c580c9a23b3654ea3391fb22afa85db0697.tar.bz2
scala-3a593c580c9a23b3654ea3391fb22afa85db0697.zip
*** empty log message ***
Diffstat (limited to 'test/neg')
-rw-r--r--test/neg/S4.check2
-rw-r--r--test/neg/constrparams.check2
-rw-r--r--test/neg/cyclic.check4
-rw-r--r--test/neg/cyclic.scala6
-rw-r--r--test/neg/protected.check5
-rw-r--r--test/neg/protected.scala14
-rw-r--r--test/neg/stable.check7
-rw-r--r--test/neg/stable.scala17
8 files changed, 55 insertions, 2 deletions
diff --git a/test/neg/S4.check b/test/neg/S4.check
index dd8ee22f5d..7fd616488b 100644
--- a/test/neg/S4.check
+++ b/test/neg/S4.check
@@ -1,4 +1,4 @@
-S4.scala:5: stable identifier required
+S4.scala:5: stable identifier required, but a found.
def foo(x: a.Inner) = x;
^
one error found
diff --git a/test/neg/constrparams.check b/test/neg/constrparams.check
index 702504ea4a..19eb56bf7f 100644
--- a/test/neg/constrparams.check
+++ b/test/neg/constrparams.check
@@ -1,4 +1,4 @@
-constrparams.scala:4: stable identifier required
+constrparams.scala:4: stable identifier required, but x found.
private val z: x.t = null; //error
^
one error found
diff --git a/test/neg/cyclic.check b/test/neg/cyclic.check
new file mode 100644
index 0000000000..2c23c8b26a
--- /dev/null
+++ b/test/neg/cyclic.check
@@ -0,0 +1,4 @@
+cyclic.scala:3: illegal cyclic reference involving type T
+ type T = List[T];
+ ^
+one error found
diff --git a/test/neg/cyclic.scala b/test/neg/cyclic.scala
new file mode 100644
index 0000000000..423fa70094
--- /dev/null
+++ b/test/neg/cyclic.scala
@@ -0,0 +1,6 @@
+abstract class test {
+
+ type T = List[T];
+ type U <: List[U];
+
+}
diff --git a/test/neg/protected.check b/test/neg/protected.check
new file mode 100644
index 0000000000..23a5865dab
--- /dev/null
+++ b/test/neg/protected.check
@@ -0,0 +1,5 @@
+protected.scala:11: error overriding method y in class A;
+ method y in class B has weaker access privileges; it should not be protected
+ protected def y(): int;
+ ^
+one error found
diff --git a/test/neg/protected.scala b/test/neg/protected.scala
new file mode 100644
index 0000000000..668317e139
--- /dev/null
+++ b/test/neg/protected.scala
@@ -0,0 +1,14 @@
+abstract class A {
+
+ protected def x(): int;
+ def y(): int;
+
+}
+
+abstract class B extends A {
+
+ def x(): int;
+ protected def y(): int;
+
+}
+
diff --git a/test/neg/stable.check b/test/neg/stable.check
new file mode 100644
index 0000000000..eaa64ef62a
--- /dev/null
+++ b/test/neg/stable.check
@@ -0,0 +1,7 @@
+stable.scala:10: stable identifier required, but test.y found.
+ type b = y.T;
+ ^
+stable.scala:11: stable identifier required, but test.z found.
+ type c = z.T;
+ ^
+two errors found
diff --git a/test/neg/stable.scala b/test/neg/stable.scala
new file mode 100644
index 0000000000..fc21df732b
--- /dev/null
+++ b/test/neg/stable.scala
@@ -0,0 +1,17 @@
+abstract class C { type T; val next: C = this }
+
+module test {
+
+ val x: C = new C { type T = int };
+ var y: C = x;
+ def z: C = x;
+
+ type a = x.T;
+ type b = y.T;
+ type c = z.T;
+ type d = x.next.next.T;
+
+ import x.T;
+
+ type e = T;
+}