Add help suggestion for object instance mistakenly used with associated function #101542
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: link
The current output is:
Since methods are called using an object instance, there is a chance that an associated function will be mistakenly called using an object instance. Therefore, the ideal output would suggest changing the object instance to the type of said instance.
Note: if mistake is changed to
x.func()
, the current error message already suggest the correct way to fix that error, shown below:The text was updated successfully, but these errors were encountered: