Class InheritedOperatorOverFieldsOrError
- All Implemented Interfaces:
Consumer<AggregateSymbol>
$, $$ and :=:
when it would otherwise INHERIT one (E07238), as E07235 already requires of ?.
An inherited $, $$ or :=: was written for the super's fields; it cannot know the fields
this type adds. So Leaf extends Base with a name property and no $ of its own printed
Base(id=1) - the name silently missing - and its copy silently copied half the object. The type declares
its own: default operator $ (which folds in the nearest super's, C2 fix 1) or a hand-written one.
"Would inherit" is THE nearest operator above (InheritedOperators.nearestAbove(IAggregateSymbol, String, ISymbol): the super CLASS chain,
never Any's - every type inherits Any's $ and $$, which are not written for any
data), abstract or not: below an abstract one a sub-type's generated operator covers only its own fields, so a
type in between that adds fields and declares nothing would lose them. "Adds fields" is the type's own
GeneratedOperatorFields.of(AggregateSymbol) - properties, and a dynamic class's captures.
NOT for #?, == or <=>: B18 seals sameness at the root of a hierarchy (E07182/E07184), so a
sub-type cannot declare them. ? is E07235. One error per type, naming every operator it would inherit.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionInheritedOperatorOverFieldsOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
InheritedOperatorOverFieldsOrError
InheritedOperatorOverFieldsOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<AggregateSymbol>
-