A covariant type parameter preserves subtyping: if , then
PartialFn[T,A] <: PartialFn[T,B] when its second parameter is covariant. In Scala the class annotation is +U. A mapping that produces a narrower output can be used where a broader output is expected. Covariance describes a type relationship; it does not convert stored values or make mutation through a widened reference safe.[ref]Scala 2.12 types specification. Relations between types: conformance of parameterized types and variance
Articles by others on the same topic
There are currently no matching articles.