Is it possible to extend trait methods by overriding them and calling super? For example:
TMyTrait >> foo
"do something"
MyClassThatUsesTrait >> foo
super foo.
"do something else"
> foo s" /> > foo s" /> > foo s"/>
Is it possible to extend trait methods by overriding them and calling super? For example:
TMyTrait >> foo
"do something"
MyClassThatUsesTrait >> foo
super foo.
"do something else"
Answered on Discord by Cyril Ferlicot:
We can override methods, but traits are here to compose stuff. Not really to specialize stuff.
That being said, there is a workaround that is based on Trait aliases (See Pharo-Wiki: https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Traits.md#alias-some-methods-received-from-the-trait)