title: Trouble with Ordered Trait in Scala
body: <p>I am attempting to define a natural ordering for distinct though similar classes of object. In Java I would use <code>Comparable</code>, and it seems the way to do the equivalent in Scala is with <code>Ordered</code>. I have the following trait:</p>
  
  <pre><code>trait Positioned extends Ordered[Positioned] {
    def position: Int = 1
  
    override def compare(that: Positioned): Int = position - that.position
  }
  </code></pre>
  
  <p>I want to apply this trait to multiple case classes like this one:</p>
  
  <pre><code>case class Image(id: String,
                   override val position: Int = 1) extends Positioned
  </code></pre>
  
  <p>This complies just fine but at runtime when I call <code>sorted</code> on a collection of these <code>Image</code> objects, I get this error:</p>
  
  <pre><code>diverging implicit expansion for type scala.math.Ordering[com.myapp.Image]
  starting with method $conforms in object Predef
  </code></pre>
  
  <p>Please let me know what this means and what I can do to fix it.</p>