Covariant match types should be removed as they can lead to contractions. For example:
type Id[+X] = X match {
case Int => Int
case String => String
}
Int & String <: String
Id[Int & String] reduces to Int, Id[String] reduces to String
- By covariance of
Id we can deduce that Int <: String, which is wrong.