-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Fix Issue 17373 - traits getOverloads + multiple interface inheritan… #7959
Conversation
|
Thanks for your pull request and interest in making D better, @RazvanN7! 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 references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#7959" |
7115c5d to
e5dc60e
Compare
src/dmd/traits.d
Outdated
| auto funcType = fd.type.toChars(); | ||
| auto len = strlen(funcType); | ||
| //printf("%s - %s\n", fd.toChars, fd.type.toChars()); | ||
| if (!funcTypeHash.lookup(funcType, len)) |
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.
- Why don't you use D strings and a normal hashmap?
toCharsis a bit of an anti-pattern. Why don't you just insert thetypedirectly?
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.
Type is a class that does not have opEquals and toHash defined.
|
@RazvanN7 Please look into the Jenkins failures. |
…e only see one of the interfaces' overloads
|
@JinShil Jenkins is green now. Later edit : and so are the other tests |
|
This PR broke Vibe.d's complex It's a shame no one noticed this before 2.081 (Vibe.d was disabled on the project tester due to issues with the dub registry at the time of this PR). |
…ce only see one of the interfaces' overloads
Interface inheritance does not create an OverloadSet for overloaded methods in different inherited interfaces. This caused traits(getOverloads) to report incorrect answers. In order to fix this I added a test so that if the symbol passed to traits is a interface declaration, all the inherited interfaces are checked to see if they add a new overload. In order to avoid counting functions with the same signature, but located in different inherited interfaces, I am using a hashtable which stores the function mangled signature.