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

Conversation

@teodutu
Copy link
Member

@teodutu teodutu commented May 23, 2022

dlang/dmd#13494 is blocked because it attempted to lower new Exception(args) to _d_newThrowable!Exception(args) and have _d_newThrowable call Exception's ctor. This created a few errors due to how forward!args works with -dip1008.

Until -dip1008 is fixed, this PR removes the call to Exception's ctor from _d_newThrowable, leaving this task to the compiler.

@teodutu teodutu requested review from andralex and wilzbach as code owners May 23, 2022 09:03
@dlang-bot
Copy link
Contributor

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#3823"

@teodutu teodutu force-pushed the _d_newThrowable-no-ctor branch 2 times, most recently from 200ab65 to af45f6f Compare May 24, 2022 10:02
@RazvanN7
Copy link
Contributor

So, essentially, you are just allocating the exception and leaving it up to the compiler to call the constructor? This looks good to me.

@RazvanN7 RazvanN7 requested a review from dkorpel May 25, 2022 07:46
@RazvanN7 RazvanN7 requested a review from ibuclaw May 26, 2022 10:19
@RazvanN7 RazvanN7 added the 72h no objection -> merge The PR will be merged if there are no objections raised. label May 26, 2022
Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment still says "and call its constructor" and "It has the same interface as `rt.lifetime._d_newclass()"

@dkorpel
Copy link
Contributor

dkorpel commented May 26, 2022

How is this not breaking the test suite, doesn't current DMD before dlang/dmd#13494 depend on the constructor being called in the hook?

@RazvanN7
Copy link
Contributor

RazvanN7 commented May 26, 2022

How is this not breaking the test suite, doesn't current DMD before dlang/dmd#13494 depend on the constructor being called in the hook?

There's only 1 runnable test in dmd and it doesn't verify any of the fields of the exception instance. It simply checks that the reference count is correct.

@dkorpel
Copy link
Contributor

dkorpel commented May 26, 2022

There's only 1 runnable test in dmd and it doesn't verify any of the fields of the exception instance.

How about buildkite? Surely there's some code in there that expects the constructor of Exceptions being actually called?

@RazvanN7
Copy link
Contributor

-dip1008 is actually pretty unusable. I wouldn't be surprised if it wasn't used that much. Anyway, the dmd PR should get in shortly, so I wouldn't stress too much about it.

@dkorpel
Copy link
Contributor

dkorpel commented May 26, 2022

-dip1008 is actually pretty unusable. I wouldn't be surprised if it wasn't used that much.

Ah, so _d_newThrowable is only used for -dip1008. Gotcha.

@RazvanN7
Copy link
Contributor

@teodutu could you update the function description so that we can merge this?

@teodutu teodutu force-pushed the _d_newThrowable-no-ctor branch 2 times, most recently from a856964 to 344d4e7 Compare May 27, 2022 06:20
@teodutu
Copy link
Member Author

teodutu commented May 27, 2022

@RazvanN7 done

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
@teodutu teodutu force-pushed the _d_newThrowable-no-ctor branch from 344d4e7 to 90dfff7 Compare May 27, 2022 08:20
@RazvanN7 RazvanN7 requested a review from dkorpel May 27, 2022 08:35
@RazvanN7 RazvanN7 merged commit d0b42e2 into dlang:master May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

72h no objection -> merge The PR will be merged if there are no objections raised.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants