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: fix pretty-printing ordering for record parameters #4366

Merged
merged 3 commits into from
Dec 21, 2021

Conversation

xzel23
Copy link
Contributor

@xzel23 xzel23 commented Dec 17, 2021

Instead of creating a new test case, I added the missing checks to the existing one. The most important one is the one with the head(records).toString(): changing the Set to LinkedHashSet makes all the other checks pass, but the output is still in reverse order.

The fix in CloneHelper is less than ideal, but I cannot think of a better solution. IMHO the visitor pattern is overused in spoon, i. e. I cannot see a valid reason to use it for cloning. The visitor pattern is necessary for double dispatch, but if I didn't miss anything, cloning just needs a single dispatch.

Please review and comment.

@xzel23
Copy link
Contributor Author

xzel23 commented Dec 20, 2021

changed the test code to make it compatible with windows

@monperrus monperrus changed the title fix #4365: spoon reorders record parameters fix: fix pretty-printing ordering for record parameters Dec 21, 2021
@monperrus monperrus merged commit 701c585 into INRIA:master Dec 21, 2021
@monperrus
Copy link
Collaborator

Thanks a lot @xzel23

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.

2 participants