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

Remove @RelevantJavaTypes annotation from SameLenChecker #6256

Merged
merged 2 commits into from Oct 24, 2023

Conversation

mernst
Copy link
Member

@mernst mernst commented Oct 23, 2023

No description provided.

kelloggm
kelloggm previously approved these changes Oct 23, 2023
@kelloggm kelloggm enabled auto-merge (squash) October 23, 2023 18:30
@@ -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 .
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

@kelloggm kelloggm merged commit 6571746 into typetools:master Oct 24, 2023
29 checks passed
@kelloggm kelloggm deleted the SameLenChecker-RelevantJavaTypes branch October 24, 2023 00:19
wmdietl pushed a commit to eisop/checker-framework that referenced this pull request Nov 22, 2023
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

2 participants