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

Finish records support #4871

Merged
merged 23 commits into from Aug 20, 2021
Merged

Finish records support #4871

merged 23 commits into from Aug 20, 2021

Conversation

neilccbrown
Copy link
Contributor

After #4802 there were two issues left to complete:

  • Allow method annotations on compact constructors in stubs
  • Support automatic transfer from declaration annotations on record components in stubs to the corresponding field, method, and compact canonical constructor parameter. (Outside stubs this is done automatically by javac.)

This PR (in combination with typetools/stubparser#72) adds support for both these items. I tried using some existing checkers for the testing but none have straightforward support for annotations on fields, methods and parameters. So I added my own simple test-only checker "DisbarUse" that gives an error when the element is used, in order to test this functionality.

I think with this, support for records is complete in all aspects, unless I've overlooked something.

neilccbrown and others added 20 commits August 6, 2021 22:57
…l directories ending in -records, thus encompassing the new lock-records directory.
…, method or field annotated as @DisbarUse, and a class which shows it works. This will be used for checking records.
…bs are not currently transferred to methods, fields and constructor parameters.
…ng annotations, rather than fetching them directly.
…ameters of canonical but non-compact constructors.
…onents across to the corresponding field, method and compact canonical constructor parameter.
Copy link
Member

@mernst mernst left a comment

Choose a reason for hiding this comment

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

Overall, this looks excellent. Thank you for tying up these loose ends!
I have just a few questions and comments; please see the review.

@neilccbrown neilccbrown assigned mernst and unassigned neilccbrown Aug 13, 2021
@neilccbrown
Copy link
Contributor Author

All the comments have been addressed so I think it is ready to merge.

@mernst mernst removed their assignment Aug 19, 2021
@smillst smillst merged commit e072376 into typetools:master Aug 20, 2021
@mernst
Copy link
Member

mernst commented Aug 20, 2021

Thanks again for the records feature!

wmdietl pushed a commit to eisop/checker-framework that referenced this pull request Sep 4, 2021
* Allow method annotations on compact constructors in stubs
* Support automatic transfer from declaration annotations on record components in stubs to the corresponding field, method, and compact canonical constructor parameter. (Outside stubs this is done automatically by javac.)
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.

None yet

3 participants