Stéphane Ducasse wrote:
>
>>> Hi all, I'm doing some work with traits, and I found something like this
>>> case:
>>>
>>> Trait T1>>m1
>>> ^self requirement
>>>
>>> Trait T2>>m1
>>> doSomeStuff
>>>
>>> Class C1 uses: T1 + T2
>>> [note, i'm not excluding m1 from T1 in the T1 + T2 composition.]
>>> And the resulting:
>>> C1>>m1
>>> doSomeStuff
>>>
>>> It is just ok, since the other m1 is just a mark for a requiredMethod,
>>> but I
>>> find this a little weird, since do not follow the Trait definition. (at
>>> least the one I read, maybe it changed!). Wouldn't be better to
>>> automatically add the exclusion at the composition?
>>> Class C1 uses: T1 - {#m1} + T2
>
>>not really. Or this means that the composition algo does not work well.
>>Now since C1 redefined m1 in both cases you will have C>>m1 taking
precedence over T1>>m1.
>>I already forget but I discussed with tom and in javascript it proposed a
different one
>>than the ones we have in smalltalk and it was coherent too.
>
> Well, what I tried to say is that C1 do not redefine m1, it gets T2>>m1
> from the T1 + T2 composition.
> So, is there a conflict if I compose T1 + T2 and do not redefine m1 in the
> composition client?
> Or is this "improvement" OK? (explicit required methods do not produce
> composition conflicts),
> since having a conflict between a real message implementation and a
> explicitRequirement marked message doesn´t make any sense
>
>
>>Now there is a bug in pharo and squeak3.9 because if C1 is in fact the
superclass
>>of the class using the trait then the requirement is not considered as
fullfiled or something like that.]
>
> Do you mean that should be expected that a trait's required method
> shouldn't hide a superclass implementation for that message?
>
> All my doubts about this issue are actually one: does a trait's required
> method any special behavior with respect to the composition (conflicts
> with equals named messages in the composition, overrides equals named
> messages in the composition's client superclass, etc), or these messages
> behave exactly like any other message?
>
>
--
View this message in context:
http://forum.world.st/trait-composition-conflict-autoresolution-tp2235790p2236064.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project