OverridingPairsChecker

dotty.tools.dotc.typer.RefChecks.OverridingPairsChecker
class OverridingPairsChecker(clazz: ClassSymbol, self: Type)(using x$3: Context) extends Cursor

A class for checking all overriding pairs of class with a given check function

Attributes

Graph
Supertypes
class Cursor
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def canBeHandledByParent(sym1: Symbol, sym2: Symbol, parent: Symbol): Boolean

We can exclude pairs safely from checking only under three additional conditions

We can exclude pairs safely from checking only under three additional conditions

  • their signatures also match in the parent class. See neg/i12828.scala for an example where this matters.
  • They overriding/overridden appear in linearization order. See neg/i5094.scala for an example where this matters.
  • The overridden symbol is not abstract override. For such symbols we need a more extensive test since the virtual super chain depends on the precise linearization order, which might be different for the subclass. See neg/i14415.scala.

Attributes

Definition Classes
def checkAll(checkOverride: ((Type, Type) => Context ?=> Boolean, Symbol, Symbol) => Unit): Unit
def checkSubType(tp1: Type, tp2: Type)(using Context): Boolean

Checks the subtype relationship tp1 <:< tp2. It is passed to the checkOverride operation in checkAll, to be used for compatibility checking.

Checks the subtype relationship tp1 <:< tp2. It is passed to the checkOverride operation in checkAll, to be used for compatibility checking.

Attributes

override def matches(sym1: Symbol, sym2: Symbol): Boolean

Does sym1 match sym2 so that it qualifies as overriding when both symbols are seen as members of self? Types always match. Term symbols match if their membertypes relative to self do.

Does sym1 match sym2 so that it qualifies as overriding when both symbols are seen as members of self? Types always match. Term symbols match if their membertypes relative to self do.

Attributes

Definition Classes
def needsCheck(overriding: Symbol, overridden: Symbol)(using Context): Boolean

A hook that allows to omit override checks between overriding and overridden. Overridden in capture checking to handle non-capture checked classes leniently.

A hook that allows to omit override checks between overriding and overridden. Overridden in capture checking to handle non-capture checked classes leniently.

Attributes

Inherited methods

final def hasNext: Boolean

Attributes

Inherited from:
Cursor
final def next(): Unit

Attributes

Inherited from:
Cursor

Inherited fields

If not null: The symbol overridden by overriding

If not null: The symbol overridden by overriding

Attributes

Inherited from:
Cursor

The current candidate symbol for overriding

The current candidate symbol for overriding

Attributes

Inherited from:
Cursor