title: Scala typebounds not working with abstract class but works with traits
body: <p>I am trying to extend the generic mSort function to work with implicits and type bounds. It works fine when I use a generic trait to extend Ordered but not with an abstract class. can you please help?</p>
  
  <pre><code>object MergeSort extends App {
  
    // With Abstract Class
    abstract class Id(id: Int) extends Ordered[Id] {
      override def compare(that: Id): Int = this.id.compareTo(that.id)
    }
    case class Emp(id: Int, name: String) extends Id(id) {
      //override def compare(that: Emp): Int = this.name.compareTo(that.name)
    }
  
  //// With Traits: Works fine
  //  trait Id extends Ordered[Id]{
  //    val id: Int
  //    override def compare(that: Id): Int = this.id.compareTo(that.id)
  //  }
  //  case class Emp(id: Int, name: String) extends Id {
  //    //override def compare(that: Emp): Int = this.name.compareTo(that.name)
  //  }
  
  
    object MSort {
      def msort[T &lt;% Ordered[T]](list: List[T])(implicit less: (T, T) =&gt; Boolean): List[T] = {
        def merge(xs: List[T], ys: List[T]): List[T] = {
      (xs, ys) match {
        case (Nil, _) =&gt; ys
        case (_, Nil) =&gt; xs
        case (x :: xs1, y :: ys1) =&gt; if (less(x, y)) x :: merge(xs1, ys) else y :: merge(xs, ys1)
      }
        }
        val n = list.length/2
        if(n==0) list
        else {
      val (ys, zs) = list.splitAt(n)
      merge(msort(ys), msort(zs))
        }
      }
    }
  
    implicit def less [T &lt;% Ordered[T]] (x: T, y: T): Boolean = x &lt;= y
  //  MSort.msort[Int](List(6, 3, 9, 1)).foreach(println)
  //  MSort.msort[Char](List('a', 'z', 'Z', 'D')).foreach(println)
  //  MSort.msort[String](List("appolo", "lunar", "Zapplin", "Kafka")).foreach(println)
  //  MSort.msort[Double](List(12.3, 14, 19.3, -32.443)).foreach(println)
    MSort.msort[Id](List(Emp(7, "appolo"), Emp(2, "lunar"), Emp(9, "Zapplin"), Emp(1, "Kafka"))).foreach(println)
  
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error:(5, 66) value id is not a member of MergeSort.Id
  override def compare(that: Id): Int = this.id.compareTo(that.id)
  </code></pre>