0
    sealed trait Condition[-CS <: AnyRef] {
  def toCondition: Condition[CS] = this
}

I know that, if it's only CS<: AnyRef, it means CS has to be a subset of the datatype any ref. But what is - used for? That it can be anything other than a subset of this data type?

Dibya Ranjan
  • 80
  • 3
  • 18
  • 2
    Possible duplicate of [Scala - Covariance](https://stackoverflow.com/questions/36935441/scala-covariance) – Dmytro Mitin Nov 14 '17 at 08:00
  • The minus sign (`-`) means that the trait `Condition` is contravariant on its type parameter. Contravariance is more than a little counterintuitive. Do a search for "scala contravariance". [This post](https://stackoverflow.com/questions/19668353/scala-contravariance-and-covariance) is a good place to start. – jwvh Nov 14 '17 at 08:15

0 Answers0