If you catch a dip1008 ref-counted throwable and pass it into the constructor of an `Error` or `Exception` the ref count isn't incremented. You have to assign via the `next` property to achieve this.
-----------------------------------
module chain
void main()
{
try {
throw new Exception("reasons...");
} catch(Exception e1) {
auto rc1 = e1.refcount();
auto e2 = new Exception("stuff...", e1); // should increment ref count
assert(e1.refcount() == rc1+1); // Assertion failure
}
}
------------------------------------
dmd -preview=dip1008 -run chain.d
[email protected](10): Assertion failure