+ ----- Method: Behavior>>basicAddTraitSelector:withMethod: (in category 'traits') ----- + basicAddTraitSelector: aSymbol withMethod: aCompiledMethod + "Add aMethod with selector aSymbol to my + methodDict. aMethod must not be defined locally. + Note that I am overridden by ClassDescription + to do a recompilation of the method if it has supersends." + + self assert: [(self includesLocalSelector: aSymbol) not]. + self ensureLocalSelectors. + self basicAddSelector: aSymbol withMethod: aCompiledMethod.!
this should be fixed. A method which comes from trait should be always copied before installing into behavior. Otherwise, super sends won't work properly, as well as you may end up with a mess, where trait holding a reference to the non-existing behavior (added then removed) , because installing a method into method dict always changes its methodClass.
Igor Stasenko wrote:
- ----- Method: Behavior>>basicAddTraitSelector:withMethod: (in
category 'traits') -----
- basicAddTraitSelector: aSymbol withMethod: aCompiledMethod
"Add aMethod with selector aSymbol to my
methodDict. aMethod must not be defined locally.
Note that I am overridden by ClassDescription
to do a recompilation of the method if it has supersends."
self assert: [(self includesLocalSelector: aSymbol) not].
self ensureLocalSelectors.
self basicAddSelector: aSymbol withMethod: aCompiledMethod.!
this should be fixed.
Long gone :-) You were only seeing this due to the flattening implicit in the conversion. To avoid conflicts in later updates I had to ensure that MC would find this method as a valid ancestor and that's why stage 2 consisted of temporarily pushing the flattened versions back. Just a bit of MC hackery :-)
Cheers, - Andreas
squeak-dev@lists.squeakfoundation.org