mirror of
https://review.haiku-os.org/buildtools
synced 2025-02-12 00:37:41 +01:00
26 lines
314 B
D
26 lines
314 B
D
|
import core.exception;
|
||
|
import core.memory;
|
||
|
|
||
|
class FailFinalization
|
||
|
{
|
||
|
int magic;
|
||
|
|
||
|
~this () @nogc nothrow
|
||
|
{
|
||
|
try
|
||
|
assert(this.magic == 42);
|
||
|
catch (AssertError) {}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void foo ()
|
||
|
{
|
||
|
auto dangling = new FailFinalization();
|
||
|
}
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
foo();
|
||
|
GC.collect();
|
||
|
}
|