diff options
author | Paul Phillips <paulp@improving.org> | 2009-10-05 05:44:58 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-10-05 05:44:58 +0000 |
commit | fad438ec01992e9aed93df85fda1d9225cceef2b (patch) | |
tree | 67235bb074be5e9a7001b8ea96973e683b68f475 /test/files | |
parent | 2672f972ebdab9e504bf88227ab0dd0046b2992d (diff) | |
download | scala-fad438ec01992e9aed93df85fda1d9225cceef2b.tar.gz scala-fad438ec01992e9aed93df85fda1d9225cceef2b.tar.bz2 scala-fad438ec01992e9aed93df85fda1d9225cceef2b.zip |
Test case for #298.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/bug298.check | 2 | ||||
-rw-r--r-- | test/files/run/bug298.scala | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/run/bug298.check b/test/files/run/bug298.check new file mode 100644 index 0000000000..1cd1d2266c --- /dev/null +++ b/test/files/run/bug298.check @@ -0,0 +1,2 @@ +List(42, 24) +List((42,42), (24,24)) diff --git a/test/files/run/bug298.scala b/test/files/run/bug298.scala new file mode 100644 index 0000000000..c6179f1b2e --- /dev/null +++ b/test/files/run/bug298.scala @@ -0,0 +1,17 @@ +object Test extends Application { + 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()" +}
\ No newline at end of file |