From fad438ec01992e9aed93df85fda1d9225cceef2b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 5 Oct 2009 05:44:58 +0000 Subject: Test case for #298. --- test/files/run/bug298.check | 2 ++ test/files/run/bug298.scala | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/files/run/bug298.check create mode 100644 test/files/run/bug298.scala 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 -- cgit v1.2.3