On Sunday, 28 September 2014 at 02:42:29 UTC, Manu via Digitalmars-d wrote:
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+@nogc, and therefore everything declared within should also be
so?

No as the function could be returned and used elsewhere, where these attribute aren't necessary. Also, inferring everything is quite expensive and we want D to compile fast.

But maybe inference could be triggered on error ?

Reply via email to