Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
All the layout of some classes is wrong, due to some ancient bug. The bug fix has been integrated but all the classes that have been modified in-between may have this problem. To fix that you have to force the rebuild of these classes (by adding then removing a dummy inst var for ex).
ivName := 'anIVNameImPrettySureNobodyUses'.
all := Smalltalk allClasses flatCollect: [ :e | { e . e class } ].
candidates := all reject: [ :e | e superclass isNil or: [e layout slotScope isKindOf: LayoutEmptyScope ] ].
toRebuild := candidates reject: [ :e | e superclass layout slotScope == e layout slotScope parentScope ].
toRebuild do: [ :e | e addInstVarNamed: ivName ].
toRebuild do: [ :e |
(e isClassSide
ifTrue: [ (Smalltalk at: e instanceSide name) classSide ]
ifFalse: [ Smalltalk at: e name ]) removeInstVarNamed: ivName ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.