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: don't fail entire rewrite if recursive type did not match anywhere at top-level #85

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

Gegy
Copy link
Member

@Gegy Gegy commented Jan 25, 2024

Usually, rewrites to recursive types are deeply nested - which will cause any failure to fallback to no-op (through most Type.all() implementations). The semantics of everywhere are similar to all - if nothing can be rewritten internally, that is not an error state.

This will cause no fixer function to be produced if a top-level recursive type has a fixer defined within a version range, but that type does not exist within the type being fixed.

Doesn't currently impact Vanilla, but became a bit more likely with 1a8eb41.

@Gegy Gegy self-assigned this Jan 25, 2024
@fry-mojang fry-mojang self-requested a review January 25, 2024 09:07
@nazarovtr nazarovtr self-requested a review January 25, 2024 09:09
Copy link
Contributor

@fry-mojang fry-mojang left a comment

Choose a reason for hiding this comment

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

I believe returning nop and empty should be mostly equivalent in general; I remember it being useful to see if the fixer failed to apply to any type at all, but maybe comparing the result to nop on the top-level is a better way to see that

@Gegy Gegy merged commit b218f10 into master Jan 25, 2024
2 checks passed
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.

3 participants