diff options
Diffstat (limited to 'test/neg')
-rw-r--r-- | test/neg/bounds.check | 4 | ||||
-rw-r--r-- | test/neg/bounds.scala | 12 |
2 files changed, 16 insertions, 0 deletions
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) { +} |