diff options
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/t1843.scala | 2 | ||||
-rw-r--r-- | tests/pos/typers.scala | 2 | ||||
-rw-r--r-- | tests/pos/variances.scala | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/tests/pos/t1843.scala b/tests/pos/t1843.scala index e9b5c5d2d..5e8554a93 100644 --- a/tests/pos/t1843.scala +++ b/tests/pos/t1843.scala @@ -5,7 +5,7 @@ */ object Crash { - trait UpdateType[A] + trait UpdateType[+A] case class StateUpdate[+A](updateType : UpdateType[A], value : A) case object IntegerUpdateType extends UpdateType[Integer] diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala index a95af558e..b2d786c1c 100644 --- a/tests/pos/typers.scala +++ b/tests/pos/typers.scala @@ -32,7 +32,7 @@ object typers { } class List[+T] { - def :: (x: T) = new :: (x, this) + def :: [U >: T](x: U): List[U] = new :: (x, this) def len: Int = this match { case x :: xs1 => 1 + xs1.len diff --git a/tests/pos/variances.scala b/tests/pos/variances.scala new file mode 100644 index 000000000..db858fd5d --- /dev/null +++ b/tests/pos/variances.scala @@ -0,0 +1,3 @@ +trait C[+T <: C[T, U], -U <: C[T, U]] { + +} |