In scala/collection-strawman, this line gives the following compilation error:
~
def removeAll(keys: IterableOnce[K]): C = fromSpecificIterable(keys.iterator().foldLeftCC[K, V](_ - _))
^^^
value - is not a member of CC[K, V]
~
Though CC is upper bounded by MapOps (see here), which provides the - operation. Note that the CC upper bound is recursive.
This code compiles fine with Scala 2.12 and 2.13.
Here is a self-contained reduced test case: https://scastie.scala-lang.org/mlfhyDXKRDasi6imUSbFfw
Not only CC is F-bounded, but we also have the C type parameter which is upper bounded by CC.
Though type C is not involved in the expression that raises the type error, if I remove it from Foo definition then the error disappears.
A beauty! Yet another nasty interaction between F-bounds and higher kinded types.