Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eMaringolo
Created April 27, 2014 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eMaringolo/11346194 to your computer and use it in GitHub Desktop.
Save eMaringolo/11346194 to your computer and use it in GitHub Desktop.
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