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

refactor: avoid generating getters for "constants" #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Fiouz
Copy link

@Fiouz Fiouz commented Oct 7, 2022

It is unlikely that the original intent was to expose getters such as getBUILT_BY_PROPERTY(), so change those properties to public fields, for the benefit of a clearer API, and more idiomatic integration with statically compiled languages.

https://docs.groovy-lang.org/docs/groovy-3.0.13/html/documentation/#_fields_and_properties

That change is source-compatible with existing dynamically compiled Groovy, but breaks compatibility with any statically compiled language (including Groovy with @CompileStatic): as the getters are removed, they now need to refer to the newly exposed fields.

It is unlikely that the original intent was to expose getters such as
`getBUILT_BY_PROPERTY()`, so change those properties to public fields,
for the benefit of a clearer API, and more idiomatic integration with
statically compiled languages.

https://docs.groovy-lang.org/docs/groovy-3.0.13/html/documentation/#_fields_and_properties

That change is source-compatible with existing dynamically compiled
Groovy, but breaks compatibility with any statically compiled language
(including Groovy with @CompileStatic): as the getters are removed, they
now need to refer to the newly exposed fields.
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