diff options
author | Martin Odersky <odersky@gmail.com> | 2015-10-21 18:30:53 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-10-21 18:50:11 +0200 |
commit | 1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4 (patch) | |
tree | 1583306f299f7852e4036498540868c1bb303210 /tests/pending/pos | |
parent | c4882896c041774b7a8beab1dcb5b4eeee4701f1 (diff) | |
download | dotty-1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4.tar.gz dotty-1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4.tar.bz2 dotty-1b81e31e4b8d6a3d3ce47d1386e65754ec5099b4.zip |
More tests
Diffstat (limited to 'tests/pending/pos')
-rw-r--r-- | tests/pending/pos/contraImplicits.scala | 18 | ||||
-rw-r--r-- | tests/pending/pos/depsel.scala | 14 |
2 files changed, 32 insertions, 0 deletions
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 + + +} |