Local functions infer attributes?

Manu via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 27 19:42:22 PDT 2014


void f() pure nothrow @nogc
{
   void localFunc()
   {
   }

   localFunc();
}

Complains because localFunc is not @nogc or nothrow.
Doesn't complain about pure though.

Is it reasonable to say that the scope of the outer function is
nothrow+ at nogc, and therefore everything declared within should also be
so?


More information about the Digitalmars-d mailing list