Skip to content
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 21246 - Compiler must show mismatching types when functions do not properly override #11734

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

RazvanN7
Copy link
Contributor

When the overriding function has the same name as a potential overriden function, then print the fully qualified names of the parameters of the overriden function.

@dlang-bot
Copy link
Contributor

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 verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

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

Auto-close Bugzilla Severity Description
21246 normal Compiler must show mismatching types when functions do not properly override

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11734"

@dlang-bot dlang-bot merged commit a532c4c into dlang:master Sep 15, 2020
Comment on lines +3956 to +3957
if (fd.toChars() == funcdecl.toChars())
hgs.fullQual = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those both return pointers... So we're just comparing the pointers ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. I was under the impression that was changed to return a slice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wouldn't be able to call it in printf and error if that was the case ;)

@Geod24
Copy link
Member

Geod24 commented Sep 15, 2020

Reading the description, it looks like the check should have been based on ident and not toChars.

@AndrejMitrovic
Copy link
Contributor

It would be better if it compared the two parameter symbol names, and if they are the same (but different types) then explicitly mention that in the diagnostic.

I'm afraid the diagnostics would otherwise become too verbose..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants