Skip to content
Permalink
Browse files

fix #3451: Slots: copyObject:to: needs to initialize new hidden slots

  • Loading branch information
MarcusDenker committed Jun 4, 2019
1 parent 235b376 commit 061e05d7b295deb63cf0ce96332c91da47f6dccf
@@ -16,7 +16,7 @@ ShiftAnonymousClassInstaller >> comment: newClass [
]

{ #category : #building }
ShiftAnonymousClassInstaller >> installInEnvironment: newClass. [
ShiftAnonymousClassInstaller >> installInEnvironment: newClass [.
^ self
]

@@ -82,9 +82,10 @@ ShiftClassInstaller >> copyObject: oldObject to: newClass [

"first initalize all hidden slots"
hiddenSlots := newClass classLayout allSlots reject: [:each | each isVisible].
hiddenSlots do: [ :newSlot | oldObject class slotNamed: newSlot name ifFound: [ :oldSlot |
hiddenSlots do: [ :newSlot |
newSlot initialize: newObject.
newSlot write: (oldSlot read: oldObject) to: newObject ] ].
oldObject class slotNamed: newSlot name ifFound: [ :oldSlot |
newSlot write: (oldSlot read: oldObject) to: newObject ] ].

"the initalize all visible slots"
newClass allSlots do: [ :newSlot | oldObject class slotNamed: newSlot name ifFound: [ :oldSlot |

0 comments on commit 061e05d

Please sign in to comment.
You can’t perform that action at this time.