-
-
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 23552 - Function x does not override any function, but it actually does #14704
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 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` | |||
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 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 | |||
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.
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.
This bug was happening because when a class contains some errors, its associated type is replaced with TypeError, although there is a field
bool errorsthat 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.