-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Creating a safe_suggestion attribute for coerce suggestions #37474
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.