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 23552 - Function x does not override any function, but it actually does #14704

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

RazvanN7
Copy link
Contributor

This bug was happening because when a class contains some errors, its associated type is replaced with TypeError, although there is a field bool errors that also keeps track of that. To pertain the information about the class I am keeping the type, but just updating the errors field. This required some tweaks in some places, but I think that this is a better alternative.

@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
23552 enhancement Function `x` does not override any function, but it actually does

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#14704"

@@ -1,10 +1,9 @@
/*
TEST_OUTPUT:
---
fail_compilation/test12228.d(13): Error: undefined identifier `this`, did you mean `typeof(this)`?
fail_compilation/test12228.d(18): Error: no property `x` for type `object.Object`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks like a spurios error, typeof(super) should be C here, not Object.

@@ -12,7 +12,6 @@ fail_compilation/test21008.d(117): Error: `Monitor` has no effect
fail_compilation/test21008.d(117): Error: function `object.Object.factory(string classname)` is not callable using argument types `()`
fail_compilation/test21008.d(117): too few arguments, expected 1, got 0
fail_compilation/test21008.d(105): called from here: `handleMiddlewareAnnotation()`
fail_compilation/test21008.d(108): Error: class `test21008.C` no size because of forward reference
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The base class already contains errors, so I see no point in putting this error message here. If all the above issues are handled, then the error message is correctly outputted.

@dlang-bot dlang-bot merged commit 75d7a27 into dlang:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants