[squeak-dev] The Trunk: Kernel-ar.350.mcz

Igor Stasenko siguctua at gmail.com
Thu Dec 31 13:17:31 UTC 2009


+ ----- 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.



More information about the Squeak-dev mailing list