Dotty Documentation

0.15.0-bin-SNAPSHOT

private object Validator
extends TypeAccumulator with Serializable

[-] Constructors

[-] Members

[+] private var base : Symbol
[+] def apply ( status: Option [ VarianceError ] , tp: Type ) : Option [ VarianceError ]

For PolyTypes, type parameters are skipped because they are defined explicitly (their TypeDefs will be passed here.) For MethodTypes, the same is true of the parameters (ValDefs).

[+] private def checkVarianceOfSymbol ( tvar: Symbol ) : Option [ VarianceError ]

Check variance of abstract type tvar when referred from base.

[+] def ignoreVarianceIn ( base: Symbol ) : Boolean

Is no variance checking needed within definition of base?

[+] private def paramOuter ( meth: Symbol ) : Symbol

The next level to take into account when determining the relative variance with a method parameter as base. The method is always skipped. If the method is a constructor, we also skip its class owner, because constructors are not checked for variance relative to the type parameters of their own class. On the other hand constructors do count for checking the variance of type parameters of enclosing classes. I believe the Scala 2 rules are too lenient in that respect.

[+] def relativeVariance ( tvar: Symbol , base: Symbol , v: Variance ) : Variance

The variance of a symbol occurrence of tvar seen at the level of the definition of base. The search proceeds from base to the owner of tvar. Initially the state is covariant, but it might change along the search.

[+] def relativeVariance$default$3 : FlagSet

The variance of a symbol occurrence of tvar seen at the level of the definition of base. The search proceeds from base to the owner of tvar. Initially the state is covariant, but it might change along the search.

[+] def validateDefinition ( base: Symbol ) : Option [ VarianceError ]