-
Notifications
You must be signed in to change notification settings - Fork 18
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
Only clean when the annotated type mirror is type variable #787
base: master
Are you sure you want to change the base?
Only clean when the annotated type mirror is type variable #787
Conversation
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.
Can you add the test case from the issue?
Can you make that test case self-contained, so that it doesn't depend on the CF classes?
@@ -51,6 +51,7 @@ void use( | |||
NoExplicitAnnotationsSub2 sub2, | |||
NoExplicitAnnotationsSub3 sub3) { | |||
nble = sub1.method1(); | |||
// :: error: (assignment.type.incompatible) |
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.
Can you provide a reason why this new error is desirable? Why is this change in behavior an improvement?
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.
Also note that a wilcard jtreg test fails.
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.
Can you provide a reason why this new error is desirable? Why is this change in behavior an improvement?
Because nn
is @Nonnull
and method1() is @Nullable
. So there should be an assignment incompatiable error.
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.
But method1
is in the stub file without annotations.
Shouldn't the logic be that, if something appears in the stub-file, those annotations are used. If there are no annotations in the stub-file, the usual defaults are used.
That's at least what the current behavior seems to be. This makes the stub-files readable and understandable without looking at what the corresponding source says.
Simplified version. Also updated in the issue.
|
Interesting. This crash does not happen under java 17 and happens under Java 8 and Java 11. |
It would be nicer if you just had a class in the test case instead of depending on |
You only updated the test in the issue. You should add test cases to this PR to ensure the issue is actually fixed. |
Okay, I will add it as I find the minial test case without |
Fixes #786