Class NoDuplicatedPropertyNamesOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.NoDuplicatedPropertyNamesOrError
- All Implemented Interfaces:
Consumer<AggregateSymbol>
final class NoDuplicatedPropertyNamesOrError
extends TypedSymbolAccess
implements Consumer<AggregateSymbol>
THE check that an aggregate does not redeclare a property its super chain already declares - one rule
for records, classes, components and dynamic classes (traits cannot declare properties, E07075).
Records' properties are public, so a redeclaration would be ambiguous. Class and component properties are private, but a redeclaration is still a SECOND field: the parent's methods would read the parent's copy and the sub-type's methods the sub-type's copy, so one piece of state silently splits in two (Steve's decision 8, 2026-10-03). The sub-type sets the inherited property instead. The type does not matter, only the name.
Because of this rule a generated '$$' can never emit a property name twice, so there is no separate '$$' check (E02020 was retired, decision 13, 2026-10-03).
Records' properties are public, so a redeclaration would be ambiguous. Class and component properties are private, but a redeclaration is still a SECOND field: the parent's methods would read the parent's copy and the sub-type's methods the sub-type's copy, so one piece of state silently splits in two (Steve's decision 8, 2026-10-03). The sub-type sets the inherited property instead. The type does not matter, only the name.
Because of this rule a generated '$$' can never emit a property name twice, so there is no separate '$$' check (E02020 was retired, decision 13, 2026-10-03).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionNoDuplicatedPropertyNamesOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
NoDuplicatedPropertyNamesOrError
NoDuplicatedPropertyNamesOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<AggregateSymbol>
-