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
A meta-annotation to express which TYPE_USE locations are recognized #136
Comments
The natural way to do this would be with an enum, I guess based on some combination of 9.6.4.1, 9.7.4, and 4.11: However:
|
For comparison, see the Checker Framework's |
Thanks. One thing I immediately notice is some evidence that even our concept of "location" might need to be more nuanced than the JLS's "16 type contexts": The Checker Framework lets developers distinguish between More generally, it seems unlikely that we'd get this right on our first try. Given that, this feature is another that I'd be inclined to postpone. (Another concern: We could someday find ourselves with 3 categories: "recognized," "not recognized but potentially meaningful to some tools," and "bogus." This would be similar to the "unrecognized"/"intrinsically non-nullable" distinction drawn in #135. Would tools be most interested in knowing "Is this recognized?" or "Is this bogus?" or both? Until we know, it's hard to decide what to put in the meta-annotation and what to call it.) |
The one use case we have for this right now would not really benefit very cleanly from this meta-annotation.. there are some very fine-grained distinctions we're having to make. Needs more use cases. |
Following #101's earlier proposal of a meta-annotation:
For nullness, we don't assign meaning to annotations in certain locations, like
class @Nullable Foo {}
andclass Foo extends @Nullable Bar
. Perhaps we'd want a declarative way to label our annotations to specify which locations are applicable.(But will we really even define many other type annotations? Maybe, but quite possibly not.)
Not a high priority in any case.
The text was updated successfully, but these errors were encountered: