typetools / typetools/checker-framework
Annotating the receiver
Open
@smillst is already working on this.
Since Apr 22, 2019.
enhancement
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Java does not permit the receiver (the this formal parameter) to be written explicitly on a method in an anonymous class. Therefore, it is not possible to write an annotation on it.
However, it is sometimes necessary to write an annotation on the (inexpressible) receiver.
I propose that the following two syntaxes should have identical effect:
void myMethod(@Anno MyClass this, int x) { ... }
@ReceiverQualifier(Anno.class)
void myMethod(int x) { ... }
Work can occur in the issue2433 branch, which has rudimentary documentation and defines the @ReceiverQualifier annotation (but has no test cases yet).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.