Comment #0 by christopher.winter — 2023-10-25T03:48:56Z
This code results in an error that "Nothrow.~this` is not `nothrow`", despite it being marked `nothrow`. The error is given at the `scope n = Nothrow()` line.
Either the nothrow annotation on the destructor is ignored, or the destructor cannot be marked nothrow with that implementation, in which case that should be the error, with the location given as the malformed destructor.
```
struct ThrowsDestructor
{
~this()
{
}
}
struct Nothrow
{
~this() nothrow @trusted
{
try
{
_t = ThrowsDestructor.init;
}
catch(Exception e)
{
}
}
ThrowsDestructor _t;
}
void test() nothrow
{
scope n = Nothrow();
}
void main()
{
}
```
Comment #1 by robert.schadek — 2024-12-13T19:31:18Z