Class SamenessAbove
java.lang.Object
org.ek9lang.compiler.support.sameness.SamenessAbove
THE walk behind
InheritedSameness, SealedSameness and SortOwnerAbove: the first sameness
above a type (its supers and traits, breadth first, each once) whose declaring type passes an owner test. A
parameterised type is looked through to its generic, whose declared operators it carries - in
EXPLICIT_TYPE_SYMBOL_DEFINITION a parameterisation may have no members yet, and a plain and a generic super must give
the same answer (D24, scenarios s01a/s01b).
DEFENSIVE: this runs at the end of EXPLICIT_TYPE_SYMBOL_DEFINITION, before TYPE_HIERARCHY_CHECKS reports a circular
hierarchy, so it walks with its own visited set rather than getAllTraits() (which recurses without one and
overflowed on a loop). A broken hierarchy must neither error nor crash here.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordOne sameness found above a type: the level of the walk it was found at (a parameterised type stays itself, so its display name can be rendered) and the operator, read from that level's declaring type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) IAggregateSymboldeclaringType(IAggregateSymbol level) The type whose declarations a level of the walk reads: a parameterised type's generic, else the type itself.(package private) Optional<SamenessAbove.Found> first(IAggregateSymbol aggregate, Predicate<IAggregateSymbol> skip, Predicate<IAggregateSymbol> ownerTest) The first sameness aboveaggregatewhose declaring type passesownerTest, passing over each levelskipholds for.
-
Constructor Details
-
SamenessAbove
SamenessAbove()
-
-
Method Details
-
first
Optional<SamenessAbove.Found> first(IAggregateSymbol aggregate, Predicate<IAggregateSymbol> skip, Predicate<IAggregateSymbol> ownerTest) The first sameness aboveaggregatewhose declaring type passesownerTest, passing over each levelskipholds for. -
declaringType
The type whose declarations a level of the walk reads: a parameterised type's generic, else the type itself.
-