Class ApplyTraitsOrError

java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase2.ApplyTraitsOrError
All Implemented Interfaces:
BiConsumer<EK9Parser.TraitsListContext, AggregateWithTraitsSymbol>

final class ApplyTraitsOrError extends RuleSupport implements BiConsumer<EK9Parser.TraitsListContext, AggregateWithTraitsSymbol>
Resolves each trait in a 'traitsList' (checking it is a suitable CLASS_TRAIT to extend) and adds it to the supplied aggregate. A null traitsList is tolerated (nothing to add).

Centralises the resolve-each-trait-and-add loop that was otherwise repeated verbatim by every construct that can have traits (trait declarations, dynamic classes, class declarations).