Don't use erased type for diagnostic output#1604
Conversation
wmdietl
left a comment
There was a problem hiding this comment.
Thanks!
A changelog entry/closed issue note would be good.
framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
Outdated
Show resolved
Hide resolved
wmdietl
left a comment
There was a problem hiding this comment.
Thanks for the updates. Please think a bit more about what this code should do.
framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Werner Dietl <wdietl@gmail.com>
|
@wmdietl I agree the logic does not make sense. We had #793 to make the logic consistent, and it checks for type argument annotations on the method receiver. So, there are two things that need to be changed in this logic.
Do we still want two separate PRs? Or we can use #793 to do both. |
There was a problem hiding this comment.
| AnnotatedTypeMirror methodReceiver = method.getReceiverType(); | |
| AnnotatedTypeMirror erasedMethodReceiver = methodReceiver.getErased(); |
How about introducing this extra variable instead of calling the same method four times?
There was a problem hiding this comment.
Thanks for the suggestion. I directly committed locally and made this suggestion outdated. Sorry about that.
This PR improves diagnostic output for method invocation mismatches by using exact type arguments instead of RAW types. It also added a test case for error reporting in method invocation mismatches.
Seperate from #793