VarianceChecker

dotty.tools.dotc.typer.VarianceChecker$
See theVarianceChecker companion class

Provides check method to check that all top-level definitions in tree are variance correct. Does not recurse inside methods. The method should be invoked once for each Template.

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

case class VarianceError(tvar: Symbol, required: Variance)

Attributes

Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def check(tree: Tree)(using Context): Unit
def checkLambda(tree: LambdaTypeTree, bounds: TypeBounds)(using Context): Unit

Check that variances of type lambda correspond to their occurrences in its body. Note: this is achieved by a mechanism separate from checking class type parameters. Question: Can the two mechanisms be combined in one?

Check that variances of type lambda correspond to their occurrences in its body. Note: this is achieved by a mechanism separate from checking class type parameters. Question: Can the two mechanisms be combined in one?

Attributes