Skip to content

Conversation

@AlexisCnockaert
Copy link
Collaborator

Implemented fully a driver for ReTemporaryToInstanceVariableRefactoring (which was not used actually, now is) with also new driver tests that covers all the changes

@AlexisCnockaert
Copy link
Collaborator Author

AlexisCnockaert commented Nov 24, 2025

@Ducasse @jecisc the two tests that are failing for instance variables comes from a class that is used for the driver tests (so it is normal that temporaries have this behavior), what could be the move to do?


^ ReVariablesNotReadBeforeWrittenCondition new
subtree: parseTree;
variables: temporaryVariableName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why variables: tempVarName and not variable? or variables: { tempVarName }

{ #category : 'transforming' }
RBTemporaryToInstanceVariableRefactoring >> privateTransform [

self removeTemporaryOfClass: class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not really undersyand what is removeTemporyOfClass: doing so it is difficult for me to get further.
Trying to understand the logic: I think that there were something we should keep.
If one of the subclass got the same instance variable that the temp we want to convert, then we remove it from that class and defines it in the root class.
So why removing this logic.
Because now if a subclass has the variable with the same name we force the guy to do a pullUp.
May be this is better this way the developer has to see it.

#package : 'Refactoring-DataForTesting',
#tag : 'ForConvertingVariables'
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the scenario where a subclass has the same name as the temp that we want to convert.


{ #category : 'execution' }
ReConvertTemporaryToInstanceVariableDriver >> handleBreakingChanges [

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In latest Pharo you can remove this method because it is done in a different way in the superclass.

@Ducasse Ducasse added the Status: Need more work The issue is nearly ready. Waiting some last bits. label Nov 25, 2025
@Ducasse Ducasse merged commit dd3a2b2 into pharo-project:Pharo14 Nov 27, 2025
1 check failed
@jecisc
Copy link
Member

jecisc commented Nov 27, 2025

This test has a failing test that was not there before I think

testExternalBasicToolsDependencies MacOSX64.System.Dependencies.Tests.SystemDependenciesTest
6 0.12 sec
Error Details

Given Collections do not match! additions : #('Calypso-SystemTools-QueryBrowser') missing: #()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Project: Refactorings Status: Need more work The issue is nearly ready. Waiting some last bits.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants