Remove const qual from covariant methods in Type hierarchy#10330
Remove const qual from covariant methods in Type hierarchy#10330edi33416 wants to merge 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request and interest in making D better, @edi33416! 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 fetch digger
dub run digger -- build "master + dmd#10330" |
|
What's the point of removing existing |
|
@jacob-carlborg D supports a finer-grained covariance than C++, which does not allow covariance on const methods overriding non-const methods. |
|
Ok, I see. |
Geod24
left a comment
There was a problem hiding this comment.
This does not seem like an improvement to the code.
Covariant const is a great tool, and AFAIK is currently supported in the bindings we have, so loosing this because of auto-generation is far from appealing.
|
The manual C++ headers just add the additional qualifiers as comments. Can't the header generator just do the same, i.e. emit the prototype of the function as declared in the introducing base class? |
This PR is useful to the the C++ header generator to generate the dmd frontend header files that are used by
gdc.For a detailed description of the motivation, please see PR
This is an alternative to #10319 , as making the methods
constproved to be a non-trivial issue. For more details about this, follow the discussion from this comment downwards.