-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
When calling a function that is actually a method, mention it #102518
Comments
This error is reported in the phase of name resolving, |
Made some progress:
@rustbot claim |
The code in the issue seems still does not report new suggestion: |
This is because in the |
Not sure if that's actually the behavior we want -- but if we did make that suggestion even if there was a previous import suggestion, I think it would be kinda noisy. Just my opinion though. Though, it's kinda hard to give the import suggestion a lower priority than the fn->method suggestion, due to the fact that the former happens during name resolution, and the latter happens during type check... |
@compiler-errors in that case, lets keep the ticket open for this case in particular. Your PR already improves things quite a bit, we can take some time to think about how to best go about this other case. |
Current output:
|
Given code like
cos(3.3);
wherecos
is a method off64
, we currently look for free functions elsewhere in the dependency tree:But we should also check for existence of methods under that name for its sole argument.
The text was updated successfully, but these errors were encountered: