Variance Annotations
- trait Producer[+Y] { def apply () : Y }
- trait Consumer[-X] { def apply (x:X) : Unit }
- trait Function[-X,+Y] { def apply (x:X) : Y }
- trait Operator[X] { def apply (x:X) : X }
- trait Producer[-Y] { def apply () : Y }
- ^
- error: contravariant type Y occurs in covariant position
- trait Consumer[+X] { def apply (x:X) : Unit }
- ^
- error: covariant type X occurs in contravariant position