-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Quick Fixes for Class Modifier Diagnostics #51440
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
Comments
There's only one diagnostic so far: Without knowing the specific semantics the user is trying to achieve, the only fixes I can think of are to
I don't know how common any of those fixes are likely to be, so I don't know how useful any of these fixes would be to automate. For the first, we have a fix that will look for similarly named types, though it doesn't know about the capability modifiers, so it might suggest a different class that's equally inappropriate. That limitation should be fixed for other reasons, even if we don't apply that fix here. For the second, we could obviously remove the code. For the third, we could update the modifiers appropriately (when the declaration of the type is in a file that's explicitly being analyzed), though there are likely to be a lot of cases to consider. @kallentu In case you have ideas on this topic, including other diagnostics that still need to be added. |
Change the usage, if possible? (so |
Definitely an interesting possibility, thanks. I'm not sure how often those would be useful either, but then I don't know much about how best to help users around these errors. |
A fix to add |
Agreed. I wasn't thinking about the lint that hasn't been added yet, just the existing diagnostics. :-) |
There's And there will be another error diagnostic for the part of the spec that specifies Also, for what currently is For |
We didn't create issues or even a check list for any of these ideas. Do we know of any fixes that would be particularly valuable? |
Maybe these ones are low hanging fruit? Although, people will encounter |
I don't know. It's hard for me to guess at (a) how often users will run into these errors and (b) whether these fixes are what users are going to want to do to fix the error. All of these suggestions are reasonable ways to fix the error, I just don't know whether it's worth the cost for us to implement them. I wouldn't object to having them, I just don't want to ask anyone to go to heroic lengths to get them implemented before the deadline. Below is an attempt to evaluate the value of each, but I don't claim to have all the information necessary to make a good choice. If we decide to not do some or all of these, it would be good to capture the ideas in the
Or move the class to the It's kind of hard to know what the right solution is without more context than we can get from static analysis. My inclination at this point would be to not offer any of these fixes because I don't know that they'd bring enough value to users.
This one sounds more promising, though I don't know how often this will occur when the class being used as a mixin is in the same package as the use site (that is, somewhere we can edit). I'd probably pass on this one too because I wouldn't expect it to be a common issue. (We generally avoid fixes that require making non-local changes for exactly this reason.)
Or
Not sure what the fix would be for this one. |
No description provided.
The text was updated successfully, but these errors were encountered: