scope() statements and return

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 7 05:59:52 PDT 2014


On 10/05/2014 08:01 AM, ketmar via Digitalmars-d wrote:
> On Sat, 04 Oct 2014 14:48:26 -0700
> Andrei Alexandrescu via Digitalmars-d <digitalmars-d at puremagic.com>
> wrote:
>
>> There's no interesting way to check this because functions don't list
>> the exceptions they might throw (like Java does). -- Andrei
> sure there is no way to check. this 'final try' helper is required
> exactly 'cause compiler can't do necessary checks, and programmer can
> assure compiler that "it's ok, we'll catching 'em all here!" this way
> 'try/catch' will not be "nothrow", only 'final try/catch'. and there
> will be *nothing* that can be catched outside of 'final try/catch'.
> i.e. if something was not catched in 'final', it's a fatal bug.
> crash-boom-band, we are dead.
>
> but i don't want to create ER, 'cause it will be rejected. it implies
> code breaking ("simple" try/catch can't be used in 'nothrow' functions
> anymore), and ERs with code breaking feature have no chances.

What's the point anyway?

try{ ... }
catch assert(0);


More information about the Digitalmars-d mailing list