August 17, 2017 Re: Exception chaining and collectException | ||||
---|---|---|---|---|
| ||||
Here's a reduced example that does not depend on std.exception:
-------
import std.stdio;
class MyException : Exception
{
this() { super("MYMY"); }
}
struct S
{
~this()
{
try { throw new MyException; }
catch(MyException e) { writefln("Collected MyException: %s", e.msg); }
catch(Exception e) { writefln("Collected Exception: %s", e.msg); }
}
void method() { throw new Exception("Dumb error"); }
}
void main()
{
try {
S s;
s.method();
} catch(Exception) {}
}
-------
Expected output:
Collected MyException: MYMY
Actual output:
Collected Exception: MYMY
Looks like a bug in druntime, or a codegen bug?
T
--
Help a man when he is in trouble and he will remember you when he is in trouble again.
|
August 17, 2017 Re: Exception chaining and collectException | ||||
---|---|---|---|---|
| ||||
Filed a bug: https://issues.dlang.org/show_bug.cgi?id=17760 --T |
Copyright © 1999-2021 by the D Language Foundation