A nothrow function will refuse an explicit call to "throw Error":
nothrow void foo()
{
assert(1, "Some error");
assert(0, "Some error");
}
//This is fine
nothrow void bar()
{
throw new Error("Some error");
}
//This is NOT fine
Error: object.Error is thrown but not caught
Error: function main.bar 'bar' is nothrow yet may throw
nothrow void baz()
{
try
{
throw new Error("Some error");
}
catch(Exception)
{
}
}
//This works though (!)
//Obviously, the "Error" is not caught...
Comment #1 by github-bugzilla — 2012-09-18T12:07:24Z