Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Make _d_newThrowable return a fully constructed Throwable - #3692

Merged
dlang-bot merged 1 commit into
dlang:masterfrom
teodutu:improve-_d_newThrowable
Jan 20, 2022
Merged

dlang-bot merged 1 commit into
dlang:masterfrom
teodutu:improve-_d_newThrowable

Conversation

@teodutu

@teodutu teodutu commented Jan 19, 2022

Copy link
Copy Markdown
Member

This is needed to simplify the lowering introduced in dlang/dmd#13494 from

throw (__ctfe ? new E(args) : __tmp = _d_newThrowable!E(), __tmp.__ctor(args), __tmp);

to

throw _d_newThrowable!E(args);

…hrowable`

This is needed so that the compiler can simply lower `throw new E(args)`
to `throw _d_newThrowable!E(args)`, instead of a CommaExp, which is more
difficult to handle.

Signed-off-by: Teodor Dutu <[email protected]>
@dlang-bot

Copy link
Copy Markdown

Thanks for your pull request and interest in making D better, @teodutu! 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

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3692"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants