summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-06-04 15:14:14 +0000
committerMartin Odersky <odersky@gmail.com>2003-06-04 15:14:14 +0000
commitc481e95b2f3d0a8cc98b106c971506e102702d06 (patch)
tree194bb07129be15d1f1e277ab3b0b63f7caf68b8d /test
parent3a593c580c9a23b3654ea3391fb22afa85db0697 (diff)
downloadscala-c481e95b2f3d0a8cc98b106c971506e102702d06.tar.gz
scala-c481e95b2f3d0a8cc98b106c971506e102702d06.tar.bz2
scala-c481e95b2f3d0a8cc98b106c971506e102702d06.zip
*** empty log message ***
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bounds.check4
-rw-r--r--test/files/neg/bounds.scala12
-rw-r--r--test/neg/bounds.check4
-rw-r--r--test/neg/bounds.scala12
4 files changed, 32 insertions, 0 deletions
diff --git a/test/files/neg/bounds.check b/test/files/neg/bounds.check
new file mode 100644
index 0000000000..0f4693da88
--- /dev/null
+++ b/test/files/neg/bounds.check
@@ -0,0 +1,4 @@
+bounds.scala:11: constructor A of type [T >: I](T)A[T] cannot be applied to [T]
+class B[T >: J](init: T) extends A[T](init) {
+ ^
+one error found
diff --git a/test/files/neg/bounds.scala b/test/files/neg/bounds.scala
new file mode 100644
index 0000000000..f9fbeaa674
--- /dev/null
+++ b/test/files/neg/bounds.scala
@@ -0,0 +1,12 @@
+class I {
+ def i(): Unit = {}
+}
+class J extends I {
+ def j(): Unit = {}
+}
+class A[T >: I](init: T) {
+ var y: T = new B();
+ class B() extends I {}
+}
+class B[T >: J](init: T) extends A[T](init) {
+}
diff --git a/test/neg/bounds.check b/test/neg/bounds.check
new file mode 100644
index 0000000000..0f4693da88
--- /dev/null
+++ b/test/neg/bounds.check
@@ -0,0 +1,4 @@
+bounds.scala:11: constructor A of type [T >: I](T)A[T] cannot be applied to [T]
+class B[T >: J](init: T) extends A[T](init) {
+ ^
+one error found
diff --git a/test/neg/bounds.scala b/test/neg/bounds.scala
new file mode 100644
index 0000000000..f9fbeaa674
--- /dev/null
+++ b/test/neg/bounds.scala
@@ -0,0 +1,12 @@
+class I {
+ def i(): Unit = {}
+}
+class J extends I {
+ def j(): Unit = {}
+}
+class A[T >: I](init: T) {
+ var y: T = new B();
+ class B() extends I {}
+}
+class B[T >: J](init: T) extends A[T](init) {
+}