Variances

dotty.tools.dotc.core.Variances
object Variances

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Variances.type

Members list

Type members

Types

type Variance = FlagSet

Value members

Concrete methods

Flip between covariant and contravariant

Flip between covariant and contravariant

Attributes

def varianceConforms(v1: Int, v2: Int): Boolean

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.

Attributes

def varianceConforms(tparam1: TypeParamInfo, tparam2: TypeParamInfo)(using Context): Boolean

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?

Attributes

def variancesConform(tparams1: List[TypeParamInfo], tparams2: List[TypeParamInfo])(using Context): Boolean

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.

Attributes

Concrete fields

val alwaysInvariant: Any => Invariant.type