aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-03 19:01:04 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-03 19:01:09 +0200
commit090a6a606f22ceb0b2800556f5d5de825a3941b8 (patch)
treead4cf51fe6589d2a2cdeb2d8dd519b86408acefd /tests/pos
parent220fe53ad0638c33572a9e11db0b6dc3aabd6c27 (diff)
downloaddotty-090a6a606f22ceb0b2800556f5d5de825a3941b8.tar.gz
dotty-090a6a606f22ceb0b2800556f5d5de825a3941b8.tar.bz2
dotty-090a6a606f22ceb0b2800556f5d5de825a3941b8.zip
Moved tests from pending
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/extmethods.scala5
-rw-r--r--tests/pos/t6482.scala11
-rw-r--r--tests/pos/t7022.scala9
3 files changed, 20 insertions, 5 deletions
diff --git a/tests/pos/extmethods.scala b/tests/pos/extmethods.scala
index eeab3c24f..3edfa2d75 100644
--- a/tests/pos/extmethods.scala
+++ b/tests/pos/extmethods.scala
@@ -6,11 +6,6 @@ class T[A, This <: That1[A]](val x: Int) extends AnyVal {
def const[B](): Boolean = return true
}
-final class TraversableOnceOps[+A](val collection: TraversableOnce[A]) extends AnyVal {
- def reduceLeftOption[B >: A](op: (B, A) => B): Option[B] =
- if (collection.isEmpty) None else Some(collection.reduceLeft[B](op))
-}
-
class Foo[+A <: AnyRef](val xs: List[A]) extends AnyVal {
def baz[B >: A](x: B): List[B] = ???
}
diff --git a/tests/pos/t6482.scala b/tests/pos/t6482.scala
new file mode 100644
index 000000000..24ea38e51
--- /dev/null
+++ b/tests/pos/t6482.scala
@@ -0,0 +1,11 @@
+final class TraversableOnceOps[+A](val collection: TraversableOnce[A]) extends AnyVal {
+ def reduceLeftOption[B >: A](op: (B, A) => B): Option[B] =
+ if (collection.isEmpty) None else Some(collection.reduceLeft[B](op))
+}
+// error: type arguments [B] do not conform to method reduceLeft's type parameter bounds [B >: A]
+// if (collection.isEmpty) None else Some(collection.reduceLeft[B](op))
+// ^
+
+class Foo[+A <: AnyRef](val xs: List[A]) extends AnyVal {
+ def baz[B >: A](x: B): List[B] = x :: xs
+}
diff --git a/tests/pos/t7022.scala b/tests/pos/t7022.scala
new file mode 100644
index 000000000..c86602664
--- /dev/null
+++ b/tests/pos/t7022.scala
@@ -0,0 +1,9 @@
+class Catch[+T] {
+ def either[U >: T](body: => U): Either[Throwable, U] = ???
+}
+
+object Test {
+ implicit class RichCatch[T](val c: Catch[T]) extends AnyVal {
+ def validation[U >: T](u: => U): Either[Throwable, U] = c.either(u)
+ }
+}