-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Improve error messages for missing opCmp / opEquals #20806
Conversation
Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#20806" |
99f2d7d
to
c78bd81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diid you want to update the changelog with this at some point?
I generalized the wording in the changelog already, adding examples for every single operator overload would be a bit excessive |
{ | ||
error(e.loc, "no operator `%s` for type `%s`", EXPtoString(e.op).ptr, ad.toChars); | ||
string op = e.isEqualExp() ? "bool" : "int"; | ||
errorSupplemental(ad.loc, "perhaps overload it with `%.*s %s(%s other) const {}`", op.fTuple.expand, id.toChars, other.type.toChars); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduced a regression @dkorpel
dmd/opover.d:1144:94: error: no property ‘fTuple’ for ‘op’ of type ‘string’
For reasons I can't fathom, can't reproduce this with dmd 2.103.x, but seen with all releases of gdc-(9..14)
The error doesn't look wrong either - there's no import dmd.root.string;
anywhere in the opover module!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a public import dmd.root.string: fTuple;
to dmd/errors.d, right below the public import core.stdc.stdarg;
. Are selective public imports broken on gdc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you added public import
to the errors module - action at a spooky distance. :-)
I didn't bother syncing this as gdc implementation of dmd.errors is just a set of forward declarations.
No description provided.