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
Remove @RelevantJavaTypes
annotation from SameLenChecker
#6256
Remove @RelevantJavaTypes
annotation from SameLenChecker
#6256
Conversation
@@ -1,20 +1,24 @@ | |||
// Tests that adding an @SameLen annotation to a primitive type is still | |||
// an error. | |||
|
|||
// All the errors in this test case are disabled. They were issued when `@SameLen` was restricted | |||
// to arrays and CharSequence, but @SameLen can be written on an arbitrary user-defined type: | |||
// https://checkerframework.org/manual/#index-annotating-fixed-size . |
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.
It would be better for these errors, which are on primitive types, to be preserved: @SameLen
is fine on array, CharSequences, and user-defined types, but it does not make sense on primitives.
Is there a way to use @RelevantJavaTypes
to express that? Maybe it needs to be done procedurally?
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.
I agree that behavior is desirable. There is not a way for @RelevantJavaTypes
to express that fact. We could add such a mechanism, or we could enforce the constraint procedurally. I think those belong in a different pull request than this one, which exists to unblock #6254.
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.
There is not a way for @RelevantJavaTypes to express that fact
Thanks for confirming. We can address it in a later PR.
No description provided.