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
Implement the generation of multiple copy constructors for fields #16429
base: master
Are you sure you want to change the base?
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
|
Why won't the bot auto-close the issue when this PR is merged? The commit message does contain "Fix Bugzilla Issue 20876" |
maybe because the title doesn't start with that? I'm not sure what the exact regex used is |
Thanks @thewilsonator , that was it. |
Thanks. This seems like the right approach and is what I would have expected. |
Ok, the headers need to be updated, but apart from that, it seems like the other failures are unrelated. |
|
||
this(ref const Bar _) immutable | ||
{ | ||
result ~= "C"; |
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.
result ~= "C"; | |
result ~= "D"; |
728dae4
to
2be29c5
Compare
…onstructors for fields that define copy constructors
The scheme of copy constructor generation is quite simple:
@WalterBright wanted to implement a strategy where the most restrictive copy constructor is the one that is generated, however, I think that that behavior is very close to the current one where we define an unusable inout(inout) copy constructor. I think my approach is much simpler, since the compiler is let to decide whether the copies are possible or not, however it does probably come with a compile penalty for structs that define lots of copy constructor. However, I suspect that this situation is rare.