[Glass] Grrrr cannot migrate (class rename with subclasses and with a name of a deleted class)

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Fri Aug 28 12:13:01 PDT 2015

On 8/27/15 8:41 AM, Mariano Martinez Peck via Glass wrote:
> Hi Otto,
> One of the problems I usually have when I do refactors in a class 
> hierarchy is the  'they may work on a second pass' error. It looks to 
> me that executing the gofer load of all my packages AFTER metacello is 
> an automatic workaround for this rather than having to re-run the 
> whole metacello load.  Do you remember if one of the reason you run 
> that code after metacello is also that error?


The  'they may work on a second pass' error covers a very broad category 
of problems if you see this warning and the load did not work properly 
(and you want to see the problem fixed:) we need to start characterizing 
the specific error conditions and constructing a test case so we can 
then move forward and improve the Monticell loader ...

Here is the "horribly complicated" code that is run when loading the 
errorDefinitions (`ea` in the code) ... this code addressed the small 
set of tests cases that I had at the time but if we are hitting this 
area and not making it through without a proper load, then we need to 
take a different approach to loading ...:
       [ ea errorLoadOver: (self obsoletionFor: ea) ]
         on: MessageNotUnderstood
         do: [ :ex |
           "avoid problems when loading Issue 246 bugfix"
           ea loadOver: (self obsoletionFor: ea) ] ]
         on: Error
         do: [ :ex |
           "fix for Issue 247"
           ex gsNumber = (ErrorSymbols at: #'rtErrAddDupInstvar')
             ifTrue: [
               | ar superclass |
               ar := nil.
               superclass := Smalltalk
                 at: ea superclassName asSymbol
                 ifAbsent: [ ex pass ].
               [ ar == nil ]
                 whileTrue: [
                   (ar := duplicateInstanceVarDefs at: superclass name 
asString ifAbsent: [  ])
                     == nil
                     ifTrue: [
                       (superclass := superclass superclass) == nil
                         ifTrue: [ ex pass ] ] ].
                 add: (ar at: 2);
                 addAll: (ar at: 3);
                 nextPutAll: ex description;
               ex return: nil ].
           ex pass ]


More information about the Glass mailing list