Variances

object Variances
class Object
trait Matchable
class Any

Type members

Types

Value members

Concrete methods

def compose(v: Variance, boundsVariance: Int): Variance

Map everything below Bivariant to Invariant

Map everything below Bivariant to Invariant

Flip between covariant and contravariant

Flip between covariant and contravariant

Does variance v1 conform to variance v2? This is the case if the variances are the same or sym is nonvariant.

Does variance v1 conform to variance v2? This is the case if the variances are the same or sym is nonvariant.

Does the variance of type parameter tparam1 conform to the variance of type parameter tparam2?

Does the variance of type parameter tparam1 conform to the variance of type parameter tparam2?

def varianceInAnnot(annot: Annotation)(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in type annotation annot.

Compute variance of type parameter tparam in type annotation annot.

def varianceInAnnots(annots: List[Annotation])(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in all type annotations annots.

Compute variance of type parameter tparam in all type annotations annots.

def varianceInArgs(tps: List[Type], tparams1: List[Symbol])(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in all type arguments tps which correspond to formal type parameters tparams1.

Compute variance of type parameter tparam in all type arguments tps which correspond to formal type parameters tparams1.

def varianceInSym(sym: Symbol)(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in type of symbol sym.

Compute variance of type parameter tparam in type of symbol sym.

def varianceInSyms(syms: List[Symbol])(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in types of all symbols sym.

Compute variance of type parameter tparam in types of all symbols sym.

def varianceInType(tp: Type)(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in type tp.

Compute variance of type parameter tparam in type tp.

def varianceInTypes(tps: List[Type])(tparam: Symbol)(using Context): Variance

Compute variance of type parameter tparam in all types tps.

Compute variance of type parameter tparam in all types tps.

def varianceSign(sym: Symbol)(using Context): String

Do the variances of type parameters tparams1 conform to the variances of corresponding type parameters tparams2? This is only the case if tparams1 and tparams2 have the same length.

Do the variances of type parameters tparams1 conform to the variances of corresponding type parameters tparams2? This is only the case if tparams1 and tparams2 have the same length.

Concrete fields