-
-
Notifications
You must be signed in to change notification settings - Fork 669
Run contracts on the returned object #22203
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
Conversation
|
Thanks for your pull request and interest in making D better, @limepoutine! 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 run digger -- build "master + dmd#22203" |
|
On this note, it's approved if somebody would be willing to make contracts be called by the caller instead of the callee. |
|
Does that mean hdrgen should also be able to generate contract bodies? Fixing hdrgen is much more daunting to me. |
|
Right now only classes need contract bodies specified. I don't know what the current state of it is. But the .di generator has a lot of other problems like not being run after semantic analysis has completed. |
|
Please provide an explanation of what is going on in this PR? |
|
This sets Also this happens to be an optimization for foreach with |
|
Is this pR good to go? |
|
This is technically ready, but I am trying to find a less hackish way to solve RVO madness. Will ping after a few days if this is the best thing I can do. |
05f7dac to
264b165
Compare
|
Oh yeah I dodged a bullet. Without #22189 this could corrupt the stack when @thewilsonator This is ready to go. @rikkimax I just realized caller-inserted contracts and #22078 require some fundamentally identical facilities to track the type (ref-ness included) from every possible source of value. This allows DMD to (a) generate appropriate contract calls for each branch without resorting to the base type, (b) replicate Maybe I'm the only one who writes |
Instead of a copy. Unsure if this is an optimization or a fix.