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

Print nullness or initialization type qualifiers, but not both, in error messages #2276

Open
mernst opened this issue Feb 5, 2019 · 1 comment
Milestone

Comments

@mernst
Copy link
Member

mernst commented Feb 5, 2019

When printing the "found" and "required" messages, show only, and all, the qualifiers from the relevant type hierarchy. In particular: If the problem is due to nullness, don't print @Initialized in types, which clutters the output.

This would be a big refactoring since they are both in the same type system and there is one isSubtype method that returns a boolean, without giving more information.

@mernst mernst changed the title Print relevant type qualifiers in error messages Print nullness or initialization type qualifiers, but not both, in error messages Feb 7, 2019
@mernst mernst added this to the High milestone Apr 12, 2019
@smillst
Copy link
Member

smillst commented Oct 13, 2023

The implementation of isSubtype is a loop calling

boolean isSubtype(
      AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top) 

for each hierarchy. So to implement this, for each error message, isSubtype needs to be called for each hierarchy. If it fails, then the error message should call a new method AnnotatedTypeMirror#toString(AnnotationMirror top). DefaultAnnotatedTypeFormatter needs to be changed to print one hierarchy at a time to implement the new toString method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants