Creating a safe_suggestion attribute for coerce suggestions #37474
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In #37388, coerce suggestions have been added. However, the system isn't very clever and will propose everything matching, wether or not it corresponds to the actual user's needs. For example:
In this case, we get
len()
andcapacity()
methods suggested. But in the example, we could think that the user wanted a conversion, and if this is the case, the suggestions are completely wrong.In order to improve this, @jonathandturner proposed a safe_suggestion attribute. I agree with this proposition but a few details still need to be "fixed":
I might have forget other potential issues so don't hesitate to add them if this is the case.
The text was updated successfully, but these errors were encountered: