In the first example when the class is being constructed the compiler
will find the Ordering implicit because it will know the concrete type
T.
In the first example, one needs to have an implicit Ordering[T]
in scope for the compiler to find it. The compiler by itself doesn't "make up" implicits. Since you've directly required one to be available via the second parameter list, if such an implicit exists, it will be passed down to the class constructor.
But in the second case it should also find the implicit since T
will
already be a concrete type.
The fact that T
is a concrete type at compile time doesn't help the compiler find an implicit for it. When we say T
is a concrete type, you must remember that at the call-site, T
is simply a generic type parameter, nothing more. If you don't help the compiler, it can't give the guarantee of having an implicit in scope. You need to have the method supply an implicit, this can be done via a Context Bound:
class MyList2[T: Ordering](list: T)
Which requires the existence, at compile time, of an ordering for type T
. Semantically, this is equivalent to your second parameter list.