diff options
author | Martin Odersky <odersky@gmail.com> | 2003-06-04 14:53:23 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-06-04 14:53:23 +0000 |
commit | 3a593c580c9a23b3654ea3391fb22afa85db0697 (patch) | |
tree | 193a2614a7a55cd4e5304a22e7761c88ba23f6e6 /test | |
parent | 6af6dae0df106de569e9b9cf503b3350722e58eb (diff) | |
download | scala-3a593c580c9a23b3654ea3391fb22afa85db0697.tar.gz scala-3a593c580c9a23b3654ea3391fb22afa85db0697.tar.bz2 scala-3a593c580c9a23b3654ea3391fb22afa85db0697.zip |
*** empty log message ***
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/S4.check | 2 | ||||
-rw-r--r-- | test/files/neg/constrparams.check | 2 | ||||
-rw-r--r-- | test/files/neg/cyclic.check | 4 | ||||
-rw-r--r-- | test/files/neg/cyclic.scala | 6 | ||||
-rw-r--r-- | test/files/neg/protected.check | 5 | ||||
-rw-r--r-- | test/files/neg/protected.scala | 14 | ||||
-rw-r--r-- | test/files/neg/stable.check | 7 | ||||
-rw-r--r-- | test/files/neg/stable.scala | 17 | ||||
-rw-r--r-- | test/files/pos/bug29.scala | 3 | ||||
-rw-r--r-- | test/neg/S4.check | 2 | ||||
-rw-r--r-- | test/neg/constrparams.check | 2 | ||||
-rw-r--r-- | test/neg/cyclic.check | 4 | ||||
-rw-r--r-- | test/neg/cyclic.scala | 6 | ||||
-rw-r--r-- | test/neg/protected.check | 5 | ||||
-rw-r--r-- | test/neg/protected.scala | 14 | ||||
-rw-r--r-- | test/neg/stable.check | 7 | ||||
-rw-r--r-- | test/neg/stable.scala | 17 | ||||
-rw-r--r-- | test/pos/bug29.scala | 3 |
18 files changed, 116 insertions, 4 deletions
diff --git a/test/files/neg/S4.check b/test/files/neg/S4.check index dd8ee22f5d..7fd616488b 100644 --- a/test/files/neg/S4.check +++ b/test/files/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/files/neg/constrparams.check b/test/files/neg/constrparams.check index 702504ea4a..19eb56bf7f 100644 --- a/test/files/neg/constrparams.check +++ b/test/files/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/files/neg/cyclic.check b/test/files/neg/cyclic.check new file mode 100644 index 0000000000..2c23c8b26a --- /dev/null +++ b/test/files/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/files/neg/cyclic.scala b/test/files/neg/cyclic.scala new file mode 100644 index 0000000000..423fa70094 --- /dev/null +++ b/test/files/neg/cyclic.scala @@ -0,0 +1,6 @@ +abstract class test { + + type T = List[T]; + type U <: List[U]; + +} diff --git a/test/files/neg/protected.check b/test/files/neg/protected.check new file mode 100644 index 0000000000..23a5865dab --- /dev/null +++ b/test/files/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/files/neg/protected.scala b/test/files/neg/protected.scala new file mode 100644 index 0000000000..668317e139 --- /dev/null +++ b/test/files/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/files/neg/stable.check b/test/files/neg/stable.check new file mode 100644 index 0000000000..eaa64ef62a --- /dev/null +++ b/test/files/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/files/neg/stable.scala b/test/files/neg/stable.scala new file mode 100644 index 0000000000..fc21df732b --- /dev/null +++ b/test/files/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; +} diff --git a/test/files/pos/bug29.scala b/test/files/pos/bug29.scala new file mode 100644 index 0000000000..1b33c6cffd --- /dev/null +++ b/test/files/pos/bug29.scala @@ -0,0 +1,3 @@ +object Main { + def f[a]: List[List[a]] = for (val l1 <- Nil; val l2 <- Nil) yield l1; +} 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; +} diff --git a/test/pos/bug29.scala b/test/pos/bug29.scala new file mode 100644 index 0000000000..1b33c6cffd --- /dev/null +++ b/test/pos/bug29.scala @@ -0,0 +1,3 @@ +object Main { + def f[a]: List[List[a]] = for (val l1 <- Nil; val l2 <- Nil) yield l1; +} |