[Issue 4484] Warning for unreachable code in scope statements is too confusing

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 15 01:57:36 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4484


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
           Severity|enhancement                 |normal


--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2010-11-15 01:56:17 PST ---
scope(failure) assert(0);

would be another nice thing to be able to do - particularly when trying to
ensure that a function is nothrow (but it results in the error about a
statement being unreachable). Putting the whole function in a try-catch block
to do that is definitely uglier.

In any case, I think that I'm promoting this to a normal bug rather than an
enhancement request. The fact that scope statements translate into try-catch
blocks is an implementation detail which shouldn't leak into error messages.
While it makes good sense to implement scope that way, I'm not sure that
there's anything really requiring that it be implemented that way, and the
errors about unreachable code make various useful constructs illegal when they
really shouldn't be.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list