Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix constructor cleanup #619

Closed
wants to merge 3 commits into from
Closed

Fix constructor cleanup #619

wants to merge 3 commits into from

Conversation

Adarsh-NP
Copy link
Contributor

This PR adds the feature to clean local variables declared inside the initializer of a class. Please refer to tests to understand the scenarios.
Points to look into:

  • In case of more than one init in a single file, this fails. While the reasoning is a bit unclear, the suspect is that piranha gets confused in the initializer scope in presence of another init because we are not able to differentiate on parameters.
  • This PR doesn't clean the variable declarations inside computed variables which is a regression compared to earlier versions. This is happening because we've restricted delete_field_intialization to only clean variables declared with modifiers which was cleaning these cases as well earlier. It doesn't anymore because we are restricting to have a visibility modifier.

@Adarsh-NP Adarsh-NP closed this Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant