OverridingPairs
A module that can produce a kind of iterator (Cursor
),
which yields all pairs of overriding/overridden symbols
that are visible in some baseclass, unless there's a parent class
that already contains the same pairs.
Adapted from the 2.9 version of OverridingPairs. The 2.10 version is IMO way too unwieldy to be maintained.
Type members
Value members
Concrete methods
Is this sym1
considered an override of sym2
(or vice versa) if both are
seen as members of site
?
We declare a match if either we have a full match including matching names
or we have a loose match with different target name but the types are the same.
We leave out pairs of methods in Java classes under the assumption since these
have already been checked and handled by javac.
This leaves two possible sorts of discrepancies to be reported as errors
in RefChecks
:
Is this sym1
considered an override of sym2
(or vice versa) if both are
seen as members of site
?
We declare a match if either we have a full match including matching names
or we have a loose match with different target name but the types are the same.
We leave out pairs of methods in Java classes under the assumption since these
have already been checked and handled by javac.
This leaves two possible sorts of discrepancies to be reported as errors
in RefChecks
:
- matching names, target names, and signatures but different types
- matching names and types, but different target names
This method is used as a replacement of matches
in some subclasses of
OverridingPairs.
Let member
and other
be members of some common class C with types
memberTp
and otherTp
in C. Are the two symbols considered an overriding
pair in C? We assume that names already match so we test only the types here.
Let member
and other
be members of some common class C with types
memberTp
and otherTp
in C. Are the two symbols considered an overriding
pair in C? We assume that names already match so we test only the types here.
- Value parameters:
- fallBack
A function called if the initial test is false and
member
andother
are term symbols.