-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
When I inserted custom dtor ~this() nothrow {}
to the existing class in unittest, it failed.
mir-algorithm/source/mir/rc/ptr.d
Lines 248 to 253 in c316ed2
static class C : D, I | |
{ | |
double value; | |
ref double bar() @safe pure nothrow @nogc { return value; } | |
this(double d) { value = d; } | |
} |
dub test
Generating test runner configuration 'mir-algorithm-test-default' for 'default' (library).
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847
Performing "unittest" build using /home/karita/dlang/dmd-2.087.0/linux/bin64/dmd for x86_64.
mir-core 0.3.5: target for configuration "library" is up to date.
mir-algorithm 3.5.0-alpha11: building configuration "mir-algorithm-test-default"...
Warning: multivariate cubic spline with derivatives was not tested!!!
Warning: multivariate cubic spline with derivatives was not tested!!!
source/mir/type_info.d(72,29): Error: function object.destroy!(true, C).destroy is not nothrow
source/mir/type_info.d(59,21): Error: nothrow function mir.type_info.mir_get_type_info!(C).mir_get_type_info.destroy_impl may throw
source/mir/rc/ptr.d(128,42): Error: template instance `mir.type_info.mir_get_type_info!(C)` error instantiating
source/mir/rc/ptr.d(225,27): instantiated from here: __ctor!int
source/mir/rc/ptr.d(256,24): instantiated from here: createRC!int
/home/karita/dlang/dmd-2.087.0/linux/bin64/dmd failed with exit code 1.
I do not know why this happened because everything seems to be nothrow.
destroy
is ok because it is template just callingrt_finalize
https://github.com/dlang/druntime/blob/3ba98e659dc6857d7f5ad6383adc2b02510ce597/src/object.d#L628rt_finalize
is also nothrow https://github.com/dlang/druntime/blob/8a5e6f2fe878d9470a39ebee2574892370af5e01/src/rt/lifetime.d#L1423
@9il Do you have any idea or workaround to call createRC
with the class having custom dtor?
Metadata
Metadata
Assignees
Labels
No labels