Only clean when the annotated type mirror is type variable#787
Only clean when the annotated type mirror is type variable#787aosen-xiong wants to merge 4 commits into
Conversation
wmdietl
left a comment
There was a problem hiding this comment.
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?
| NoExplicitAnnotationsSub2 sub2, | ||
| NoExplicitAnnotationsSub3 sub3) { | ||
| nble = sub1.method1(); | ||
| // :: error: (assignment.type.incompatible) |
There was a problem hiding this comment.
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.
Also note that a wilcard jtreg test fails.
There was a problem hiding this comment.
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.
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 |
|
Superseded by PR #1810, I did not realize this draft PR when I opened the new one; closing this PR. |
Fixes #786