I've been trying out the refactoring tools with a specific 2 subclasses of a common class example - and I didn't get this problem either - I could push up methods and pull up instance variables of my two common subclasses.

The only point I would note - it seems inconsistent that you "pull up" instance variables but "push up" methods (I recall it was a naming act of history, but it would be nice to call it "push up" everywhere.)

Tim

On 7 Aug 2010, at 21:39, Lukas Renggli wrote:

I cannot reproduce. If you look at the code you should see that what
you describe should not happen:

transform
        class allSubclasses do:
                        [:each |
                        (each directlyDefinesInstanceVariable: variableName)
                                ifTrue: [each removeInstanceVariable: 
variableName]].
        class addInstanceVariable: variableName

Maybe your class hierarchy is broken?

Lukas

On 7 August 2010 22:18, Niko Schwarz <[email protected]> wrote:
Here's a funny way to crash your image. Works in:

Pharo-1.1-11367-Beta
Latest update: #11367

Make a class named AbstractBla, with two subclasses: SubA, SubB. Then,
add to both SubA and SubB the identically named instance variable:
instVar. Now, use the "pull up" refactoring in OmniBrowser on SubA to
pull up instVar into the superclass. As you correctly guess, that
breaks SubB, because now both its superclass and SubB have an instance
variable named instVar. But, instead of refusing to refactor,
OmniBrowser dutifully refactors and takes the image with it.

I hope that was understandable.

Cheers,

Niko


--
http://scg.unibe.ch/staff/Schwarz
twitter.com/nes1983
Tel: +41 076 235 8683

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project




--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to