Disallow catch without parameter ("LastCatch")
grauzone
none at example.net
Sun Oct 25 04:09:26 PDT 2009
Right now, you can catch every exception with "try { something; } catch
{ somethingelse; }".
Can we get rid of this abomination before D2 is finalized? I claim that
it's completely useless, and even more so, every single use of this is a
bug.
If you really want to catch everything, you might as well write "catch
(Exception o)", or "catch (Throwable o)" for those who know what they're
doing.
PS: I wonder, should the runtime really execute finally blocks if an
"Error" exception is thrown? (Errors are for runtime errors, Exception
for normal exceptions.) Isn't it dangerous to execute arbitrary user
code in presence of what is basically an internal error?
More information about the Digitalmars-d
mailing list