summaryrefslogtreecommitdiff
path: root/test/files/run/bug298.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-10-05 05:44:58 +0000
committerPaul Phillips <paulp@improving.org>2009-10-05 05:44:58 +0000
commitfad438ec01992e9aed93df85fda1d9225cceef2b (patch)
tree67235bb074be5e9a7001b8ea96973e683b68f475 /test/files/run/bug298.scala
parent2672f972ebdab9e504bf88227ab0dd0046b2992d (diff)
downloadscala-fad438ec01992e9aed93df85fda1d9225cceef2b.tar.gz
scala-fad438ec01992e9aed93df85fda1d9225cceef2b.tar.bz2
scala-fad438ec01992e9aed93df85fda1d9225cceef2b.zip
Test case for #298.
Diffstat (limited to 'test/files/run/bug298.scala')
-rw-r--r--test/files/run/bug298.scala17
1 files changed, 17 insertions, 0 deletions
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