Hello everyone! What is the best way to give an alias for multiple mixed-in traits and group them? For example, I’d want to write something like this:
type NounAttributes = HasDeclensionTypeAndSubtype with HasStressType with HasStem with IsPartOfSpeech with HasSyntacticAndMorphologicalCharacteristics with HasInitialForm with HasGender with HasAnimacy
type NounFormAttributes = HasNumber with HasCase with HasStress
class NounForm private[Noun]() extends NounAttributes with NounFormAttributes { ... }
instead of:
class NounForm private[Noun]() extends
//noun attributes
HasDeclensionTypeAndSubtype with HasStressType with HasStem with IsPartOfSpeech
with HasSyntacticAndMorphologicalCharacteristics with HasInitialForm with HasGender with HasAnimacy
//noun form attributes
with HasNumber with HasCase with HasStress { ... }
One solution that came to my head is to define an empty trait in the Noun class like this:
private[Noun] trait NounFormAttributes extends HasNumber with HasCase with HasStress
and use it instead, but I don’t like it and can’t understand why the ‘type’ keyword doesn’t work in this case.
Thank you in advance!