VarianceChecker

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.

Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

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

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?