Scala: type arguments do not conform to class type parameter bounds
<p>My code</p>

<pre><code>object TestApp extends App {   
  class A[T &lt;: Ordered[T]] {
    def check(f: T, s: T) = f &gt; s
  }    
  object A {
    def apply[T] = new A[T]
  }   
  A[String].check("ab", "aa")    
}
</code></pre>

<p>throws an exception:</p>

<pre><code>Error:(13, 9) type arguments [T] do not conform to class A's type parameter bounds [T &lt;: Ordered[T]]
    def apply[T] = new A[T]
        ^
</code></pre>

<p>But I don't understand why. For me, it seems ok. I have a class with type variable bounded with Ordered. In companion object, I'm trying to create an instance of A. But I'm not sure if my companion object has an access to the type variable of class A. </p>

<p>How can I fix it?</p>