must flush cached mclass, when copying methods around
authorsrc
Wed, 25 Oct 2000 10:44:55 +0200
changeset 5676 db728e9fe276
parent 5675 34d5b32f9259
child 5677 52bd6bf1775f
must flush cached mclass, when copying methods around
Metaclass.st
Method.st
--- a/Metaclass.st	Wed Oct 25 10:14:20 2000 +0200
+++ b/Metaclass.st	Wed Oct 25 10:44:55 2000 +0200
@@ -1868,18 +1868,18 @@
             newMethod := oldMethod copy.
 "/            Smalltalk silentLoading ifFalse:[
 "/                Transcript showCR:'invalidating ' , selector , '...'.
-"/	      ].
+"/            ].
             newMethod makeInvalid.
         ] ifFalse:[
             newMethod := oldMethod.
+            newMethod mclass:nil.
         ].
         newMethodDict at:selector put:newMethod
     ].
     newClass methodDictionary:newMethodDict.
 
     "Modified: 7.6.1996 / 08:33:52 / stefan"
-    "Modified: 19.6.1997 / 18:27:09 / cg"
-!
+    "Modified: 19.6.1997 / 18:27:09 / cg"!
 
 copyMethodsFrom:oldClass for:newClass
     "copy all methods from oldClass to newClass.
@@ -1888,9 +1888,9 @@
      to recompile the class methods."
 
     newClass methodDictionary:(oldClass methodDictionary copy).
+    newClass methodDictionary keysAndValuesDo:[:sel :mthd | mthd mclass:nil.].
 
-    "Modified: 7.6.1996 / 08:34:43 / stefan"
-!
+    "Modified: 7.6.1996 / 08:34:43 / stefan"!
 
 differentInstanceVariableOffsetsIn:class1 and:class2
     "return a set of instance variable names which have different
@@ -2139,6 +2139,6 @@
 !Metaclass class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.172 2000-10-09 13:22:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.173 2000-10-25 08:44:35 src Exp $'
 ! !
 Metaclass initialize!
--- a/Method.st	Wed Oct 25 10:14:20 2000 +0200
+++ b/Method.st	Wed Oct 25 10:44:55 2000 +0200
@@ -420,11 +420,10 @@
 !
 
 mclass:aClass
-    mclass notNil ifTrue:[
-	'Method [warning]: mclass already set' errorPrintCR.
+    (mclass notNil and:[aClass notNil]) ifTrue:[
+        'Method [warning]: mclass already set' errorPrintCR.
     ].
-    mclass := aClass.
-!
+    mclass := aClass.!
 
 package
     "return the package-symbol"
@@ -1288,12 +1287,12 @@
 
     aCopy := super copy.
     sourcePosition notNil ifTrue:[
-	aCopy source:(self source)
+        aCopy source:(self source)
     ].
+    aCopy mclass:nil.
     ^ aCopy
 
-    "Modified: 16.1.1997 / 01:27:25 / cg"
-! !
+    "Modified: 16.1.1997 / 01:27:25 / cg"! !
 
 !Method methodsFor:'error handling'!
 
@@ -2798,6 +2797,6 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.212 2000-10-13 12:43:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.213 2000-10-25 08:44:55 src Exp $'
 ! !
 Method initialize!