summaryrefslogtreecommitdiff
path: root/test/files/neg/overloaded-implicit.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-08 20:11:41 +0000
committerPaul Phillips <paulp@improving.org>2010-11-08 20:11:41 +0000
commitb2559b3cf4516f751ad050480c50e348e03952d7 (patch)
treefd4859c561a1abacb572cf1ee4162b5f2349c53b /test/files/neg/overloaded-implicit.scala
parent71f765bc4f9ef4599855a7550dd79347c4c578ba (diff)
downloadscala-b2559b3cf4516f751ad050480c50e348e03952d7.tar.gz
scala-b2559b3cf4516f751ad050480c50e348e03952d7.tar.bz2
scala-b2559b3cf4516f751ad050480c50e348e03952d7.zip
Deprecation patrol.
the same issues as JavaConversions with respect to overloading implicit methods making them inaccessible to view bounds. Fixed JavaConverters. Added a warning for when people overload parameterized implicits: in almost all cases the name is irrelevant so there's little point in unwittingly suffering degraded functionality. No review.
Diffstat (limited to 'test/files/neg/overloaded-implicit.scala')
-rw-r--r--test/files/neg/overloaded-implicit.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/overloaded-implicit.scala b/test/files/neg/overloaded-implicit.scala
new file mode 100644
index 0000000000..68b1ceaa30
--- /dev/null
+++ b/test/files/neg/overloaded-implicit.scala
@@ -0,0 +1,17 @@
+object Test {
+ implicit def imp1[T](x: List[T]): Map[T, T] = Map()
+ implicit def imp1[T](x: Set[T]): Map[T, T] = Map()
+
+ def f[T <% Map[Int, Int]](x: T): Double = 1.0d
+
+ // not parameterized, no warning
+ implicit def imp2(x: List[Int]): String = "a"
+ implicit def imp2(x: Set[Int]): String = "b"
+
+ def g[T <% String](x: T): Double = 2.0d
+
+ def main(args: Array[String]): Unit = {
+ // println(f(List(1)))
+ println(g(List(1)))
+ }
+}