On 13 May 2015, at 09:25, Nicolai Hess <nicolaihess@web.de> wrote:
2015-05-12 12:06 GMT+02:00 Yuriy Tymchuk <yuriy.tymchuk@me.com <mailto:yuriy.tymchuk@me.com>>: Hi,
Iâve noticed that if you install a trait on a class and a trait defines explicit requirement method, and this method is defined in a super class, it is being looked up during execution through #explicitRequirement method. It was slowing down my execution by almost 20%. Is there a special way to use a Trait to avoid that, or itâs work-in-progress solution?
I find this behavior questionable, when did this change? ( I thought self explicitRequirement always signals an error and does not try to find the method in the superclass chain). Anyway, if you want to use the super class method, you can just remove the method from the trait usage.
ASuperClass subclass: #MySubclass uses: ATrait - {#theMethodDefinedInSuperclassAndTrait } instanceVariableNames: '' classVariableNames: '' category: â'
Good to know, thanks. I donât know the philosophy behind this case, but from my point of view - trait requires a method, and the class has it, itâs just that the method is defined higher in the hierarchy. Uko
regards Nicolai
Uko