diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-23 15:19:10 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-09-14 13:22:20 +0200 |
commit | 51201d23cf0b1e06ab7ab8ea8213c48d5ca12f13 (patch) | |
tree | 568114214b013a6ebe1efc0993e63465689c46b6 /tests/run/t298.scala | |
parent | d63dd11ed31f5b500fd08d630bbaec144dbee370 (diff) | |
download | dotty-51201d23cf0b1e06ab7ab8ea8213c48d5ca12f13.tar.gz dotty-51201d23cf0b1e06ab7ab8ea8213c48d5ca12f13.tar.bz2 dotty-51201d23cf0b1e06ab7ab8ea8213c48d5ca12f13.zip |
Add some run tests
Diffstat (limited to 'tests/run/t298.scala')
-rw-r--r-- | tests/run/t298.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run/t298.scala b/tests/run/t298.scala new file mode 100644 index 000000000..5728bb6c9 --- /dev/null +++ b/tests/run/t298.scala @@ -0,0 +1,17 @@ +object Test extends dotty.runtime.LegacyApp { + implicit def anyList[T]: List[T] = Nil + + implicit def intList: List[Int] = 42::24::Nil + + def foo[T](implicit x: T) = x + + val s = foo[List[Int]] + + println(s) // correct - prints "List(42, 24)" + + implicit def tupleList[T](implicit t: List[T]): List[(T,T)] = t.map(x => (x,x)) + + val t = foo[List[Tuple2[Int,Int]]] + + println(t) // incorrect - prints "List()" +} |