Closed
Description
trait Iterable[+A]
trait IterableOps[+A, +CC[_], +C] {
def concat[B >: A](suffix: Iterable[B]): CC[B] = ???
}
trait SetOps[A, +CC[X], +C <: SetOps[A, CC, C]] {
def concat(that: Iterable[A]): C = ???
}
class ChampHashSet[A] extends SetOps[A, ChampHashSet, ChampHashSet[A]] with
IterableOps[A, ChampHashSet, ChampHashSet[A]]
-- Error: tests/allan/Test.scala:15:6 ------------------------------------------
15 |class ChampHashSet[A] extends SetOps[A, ChampHashSet, ChampHashSet[A]] with
| ^
|method concat in trait IterableOps is not a legal implementation of `concat' in class ChampHashSet
| its type [B >: A](suffix: Iterable[B]): ChampHashSet[B]
| does not conform to (that: Iterable[A]): ChampHashSet[A]
one error found