I gather that you would prefer invariant generics. I know a bit about type systems but very little about subtyping so I would really enjoy some information :)
Why are covariant generics bad? (also just a link is fine)
Why are covariant generics bad? (also just a link is fine)
As an example, here's approximately how the Function trait is defined in Scala. The square brackets indicate type parameters (like angle brackets in Java), the - indicates covariance, and the + indicates contravariance.
trait Function1[-T, +R] {
def apply(arg1: T): R
}