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

[BUG] lombok.fieldDefaults.default* errors with records #2995

Closed
ivan-gomes opened this issue Oct 17, 2021 · 2 comments · Fixed by #3009
Closed

[BUG] lombok.fieldDefaults.default* errors with records #2995

ivan-gomes opened this issue Oct 17, 2021 · 2 comments · Fixed by #3009
Assignees
Labels
accepted The issue/enhancement is valid, sensible, and explained in sufficient detail bug
Milestone

Comments

@ivan-gomes
Copy link

ivan-gomes commented Oct 17, 2021

Describe the bug
When lombok.config is specified with lombok.fieldDefaults.defaultPrivate = true and/or lombok.fieldDefaults.defaultFinal = true compilation fails with the following:

error: @FieldDefaults is only supported on a class or an enum.

To Reproduce

lombok.config:

lombok.fieldDefaults.defaultPrivate = true
lombok.fieldDefaults.defaultFinal = true

Foo.java:

public record Foo() {
}

Expected behavior

While the error is valid if @FieldDefaults were explicitly used for a record, the expectation is that Java records would be excluded as a candidate for lombok.fieldDefaults.default* instead of applying and erroring.

@ivan-gomes ivan-gomes changed the title [BUG] lombok.fieldDefaults.defaultPrivate with records [BUG] lombok.fieldDefaults errors with records Oct 17, 2021
@ivan-gomes ivan-gomes changed the title [BUG] lombok.fieldDefaults errors with records [BUG] lombok.fieldDefaults.* errors with records Oct 17, 2021
@ivan-gomes ivan-gomes changed the title [BUG] lombok.fieldDefaults.* errors with records [BUG] lombok.fieldDefaults.default* errors with records Oct 17, 2021
@Rawi01 Rawi01 added accepted The issue/enhancement is valid, sensible, and explained in sufficient detail bug labels Oct 17, 2021
@Rawi01 Rawi01 self-assigned this Oct 22, 2021
@rzwitserloot
Copy link
Collaborator

I see @Rawi01 is on a roll today.

@ivan-gomes
Copy link
Author

Confirmed that this works in v1.18.24 now. Thanks @Rawi01!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The issue/enhancement is valid, sensible, and explained in sufficient detail bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants