-
Notifications
You must be signed in to change notification settings - Fork 866
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
Assignments to parameters to record compact constructors should not be marked as unused. #6635
Conversation
dcf71b0
to
b529ffc
Compare
since this is isolated to hints, we could get this in for rc3 if you want. This would have to be rebased and retargeted to delivery. regarding records: there are multiple issues coming from the fact that the IDE does not associate the record parameters from the constructor with the final fields of the record. E.g this does also break the rename refactoring, and mark occurrences etc. I was looking at the unused-hint already before, but was not sure if simply ignoring the params would be the right way to fix it in context of the other problems. checking if #4257 is fixed by this PR (edit: it is, linking issue) |
change causes one failure:
noticed also this second exception in the log (edit: exception is also on the master branch):
|
b529ffc
to
27acce2
Compare
…ors should not be marked as unused.
27acce2
to
6468b24
Compare
Right, the test must be disabled when j.l.Record is not present in the platform (that is what we typically do for other tests like this). The exception in the log seems unrelated to this patch, so something to investigate independently. Rebased to delivery. |
I am afraid that overall, we may need to tweak the feature to understand the records properly - there's probably no simple solution that would solve everything in one go. |
true! If there are many tests with JDK 17+ runtime requirements, we should consider a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes make sense to me. Tests are green, tested it manually too and the compact constructor params are no longer seen as unused.
Thanks, merging. I've edited the title as this shows in our release notes. Linking to third-party issues is fine, but as with Payara FISH labels, let's leave them out of titles or open a related issue here to reference. |
The parameters (and hence the assigned values) are implicitly used at the end of the compact constructors.
Please see:
oracle/javavscode#53