Reading the Scala by Example book and there is this example when Martin explains type bounds on page 54:
trait Set[A <: Ordered[A]] {
def incl(x: A): Set[A]
def contains(x: A): Boolean
}
and
trait Set[A <% Ordered[A]] ...
further on page 55. He also says that the <:/<% is the only change required for trait Set in order to demonstrate the type bounding possibilities.
However, when I repeat the example with my own code, the IDE complains that traits may NOT have view bounds, only type bounds. Changing the trait keyword to abstract class or changing the view bound to type bound helps. Is this a mistake in the book?