[Newbies] Send super to trait?

Marcel Taeumel marcel.taeumel at hpi.de
Fri May 7 17:21:58 UTC 2021


Hi Christoph,

traits are woven into the class where you use them. This means that you can actually overwrite the included traits as you did in your example. And Object DNU #foo. That's expecetd. :-)

Best,
Marcel
Am 07.05.2021 18:13:24 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi all,

I just was trying to activate a super method from a trait but got a DNU:

MyTrait >> #foo ^0
Object subclass: MyObject uses: MyTrait.
MyObject >> #foo ^super foo + 1

Is this not how traits are expected to work? Or is there any other way to reuse the default logic specified in the trait? Do I need to return to traditional inheritance in order to achieve this?

Thanks in advance!

Best,
Christoph
[http://www.hpi.de/]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20210507/81875480/attachment.html>


More information about the Beginners mailing list