On Friday, 16 October 2020 at 16:00:07 UTC, Steven Schveighoffer
wrote:
On 10/16/20 9:12 AM, tchaloupka wrote:
So when the exception is thrown within Foo destructor (and
it's bad on it's own but can easily happen as destructors
aren't nothrow @nogc by default).
Is this behavior expected?
I
On 10/16/20 9:05 AM, Steven Schveighoffer wrote:
> The destruction of members is outside the destructor's purview. It can't
> turn the destruction off, so it should logically be considered part of
> an enclosing function.
Thank you. Makes sense.
Ali
On 10/16/20 11:11 AM, Ali Çehreli wrote:
On 10/16/20 6:12 AM, tchaloupka wrote:
> struct Foo {
> Bar bar;
> bool err;
>
> ~this() {
> // scope(failure) destroy(bar); // < this fixes the Bar
> destructor call
> enforce(!err, "Test err");
Well, that check
On 10/16/20 9:12 AM, tchaloupka wrote:
So when the exception is thrown within Foo destructor (and it's bad on
it's own but can easily happen as destructors aren't nothrow @nogc by
default).
Is this behavior expected?
I would say it's a bug. The compiler is going to call the member
destruct
On Friday, 16 October 2020 at 15:19:51 UTC, Paul Backus wrote:
On Friday, 16 October 2020 at 13:12:04 UTC, tchaloupka wrote:
So when the exception is thrown within Foo destructor (and
it's bad on it's own but can easily happen as destructors
aren't nothrow @nogc by default).
Is this behavior
On Friday, 16 October 2020 at 13:12:04 UTC, tchaloupka wrote:
So when the exception is thrown within Foo destructor (and it's
bad on it's own but can easily happen as destructors aren't
nothrow @nogc by default).
Is this behavior expected?
This is a compiler/language bug. It was fixed in DMD
On 10/16/20 6:12 AM, tchaloupka wrote:
> struct Foo {
> Bar bar;
> bool err;
>
> ~this() {
> // scope(failure) destroy(bar); // < this fixes the Bar
> destructor call
> enforce(!err, "Test err");
Well, that check means "cannot continue", which means the compiler
Found a pretty nasty bug in vibe-d:
https://github.com/vibe-d/vibe.d/issues/2484
And it's caused by this behavior.
```D
import std;
struct Foo {
Bar bar;
bool err;
~this() {
// scope(failure) destroy(bar); // < this fixes the Bar
destructor call
enforce(!err, "Te