> On 13 May 2015, at 09:25, Nicolai Hess <[email protected]> wrote:
> 
> 
> 2015-05-12 12:06 GMT+02:00 Yuriy Tymchuk <[email protected] 
> <mailto:[email protected]>>:
> 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
> 

Reply via email to