-
Notifications
You must be signed in to change notification settings - Fork 13.4k
unhelpful error message for missing (first) self param on traiit method #7575
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
I too lost a bunch of time to this papercut recently. |
A complete test case:
This is still an issue. Since multiple rust devs have hit this themselves, nominating for production ready. |
Accepted for production-ready |
The relevant code is in |
Assigning P-low, not 1.0 blocker. |
Closes #7575. I don't think the change from a contains lookup to an iteration of the HashSet in the resolver should be much of a burden as the set of methods with the same name should be relatively small.
This code:
...signals the error message:
...which is kind of crazy, because T is bounded by CtxtFn, and I can see the definition of f9.
<before reading on: can you see the problem?>
I tore my hair out for quite a while before realizing I'd forgotten the "self" parameter on the decl of f9. This is just a papercut, but it seems like a big one to me. Fixing this--that is, signalling an error like "method f9 is declared without a
self
parameter"--would presumably require a pass in resolve which scanned for methods without a self parameter.The text was updated successfully, but these errors were encountered: