The following breaks on Scala 2.9.x, but works on 2.10+:
scala> def foo[A, C <: Traversable[A]](c: C) { println(c) }
scala> foo(Map.empty[String, Int])
<console>:9: error: inferred type arguments [Nothing,scala.collection.immutable.Map[String,Int]] do not conform to method foo's type parameter bounds [A,C <: Traversable[A]]
foo(Map.empty[String, Int])
Someone told me about the following workaround, which works on Scala 2.9.x:
scala> def foo[A, C <: Traversable[A]](c: C with Traversable[A]) { println(c) }
scala> foo(Map.empty[String, Int])
Map()
It also seems to work for other types such as strings, BitSets, etc. Is there a type that will not work with this 2.9.x workaround? I know that IsTraversableLike/etc fixes this issue in 2.10+.
Thanks,
Ryan