-
Notifications
You must be signed in to change notification settings - Fork 134
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
[Records] Unhelpful warning "Empty block should be documented" for records without components #3316
Comments
I'll take a look. I have never programmed with records so a naive question. Does a record with no data make sense ? Are there valid use cases for such ?? |
Yes, it is useful for more functional-style result values. E.g. consider
So we are using records as markers here. |
Oftopic: why not use enums instead? |
Because enums are static. But in the example above I want to return the actual values. With the structure above I can write
|
Thanks for the example. Thought provoking (at least for me.) |
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=576806#c1 @MaisiKoleni writes there: In the present ticket, we have examples of legitimate use case - so we will course correct on that account. |
records without components * Fixes eclipse-jdt#3316
records without components * Fixes eclipse-jdt#3316
When you have
Then you get the "empty block" warning for the seconds record (probably because the record has no parameters):
This warning should not be shown.
The text was updated successfully, but these errors were encountered: