aboutsummaryrefslogtreecommitdiff
path: root/tests/pending
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-21 18:30:53 +0200
committerMartin Odersky <odersky@gmail.com>2015-10-21 18:50:11 +0200
commit1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4 (patch)
tree1583306f299f7852e4036498540868c1bb303210 /tests/pending
parentc4882896c041774b7a8beab1dcb5b4eeee4701f1 (diff)
downloaddotty-1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4.tar.gz
dotty-1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4.tar.bz2
dotty-1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4.zip
More tests
Diffstat (limited to 'tests/pending')
-rw-r--r--tests/pending/neg/i827.scala0
-rw-r--r--tests/pending/pos/contraImplicits.scala18
-rw-r--r--tests/pending/pos/depsel.scala14
-rw-r--r--tests/pending/run/ordered.scala22
4 files changed, 54 insertions, 0 deletions
diff --git a/tests/pending/neg/i827.scala b/tests/pending/neg/i827.scala
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/pending/neg/i827.scala
diff --git a/tests/pending/pos/contraImplicits.scala b/tests/pending/pos/contraImplicits.scala
new file mode 100644
index 000000000..c4d659615
--- /dev/null
+++ b/tests/pending/pos/contraImplicits.scala
@@ -0,0 +1,18 @@
+import scala.reflect._
+// this needs to be fleshed out further
+class Contra[-T]
+
+object Test {
+ def getParam[T](c: Contra[T])(implicit ct: ClassTag[T]): Unit = {
+ println(ct)
+ ct
+ }
+ def f[T](x: Contra[T]): Contra[T] = x
+
+ def main(args: Array[String]): Unit = {
+ val x = f(new Contra[Int])
+ val y: Contra[Int] = x
+ getParam(new Contra[Int])
+ }
+}
+
diff --git a/tests/pending/pos/depsel.scala b/tests/pending/pos/depsel.scala
new file mode 100644
index 000000000..2cec4349e
--- /dev/null
+++ b/tests/pending/pos/depsel.scala
@@ -0,0 +1,14 @@
+// demonstrates selection on non-path types. Needs to be fleshed out to
+// become a real test.
+object Test {
+
+ class C {
+ type T
+ val f: T => T = ???
+ }
+
+ var x = new C
+ val y = x.f
+
+
+}
diff --git a/tests/pending/run/ordered.scala b/tests/pending/run/ordered.scala
new file mode 100644
index 000000000..ffcdc624b
--- /dev/null
+++ b/tests/pending/run/ordered.scala
@@ -0,0 +1,22 @@
+// infers wrong instance --> an implementatioin is missing
+trait Ord[-T] {
+ def less(x: T, y: T): Boolean
+}
+
+object Test {
+
+ implicit val anyIsOrd: Ord[Any] = new Ord[Any] {
+ def less(x: Any, y: Any): Boolean = ???
+ }
+
+ implicit val intIsOrd: Ord[Int] = new Ord[Int] {
+ def less(x: Int, y: Int): Boolean = x < y
+ }
+
+ def less[T: Ord](x: T, y: T): Boolean =
+ implicitly[Ord[T]].less(x, y)
+
+ def main(args: Array[String]) =
+ assert(less(1, 2))
+
+}