Closed
Description
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 toInt
,Id[String]
reduces toString
- By covariance of
Id
we can deduce thatInt <: String
, which is wrong.
Metadata
Metadata
Assignees
Labels
No labels