[dmd-internals] Changes for pure, nothrow, and @safe done for the moment?

Walter Bright walter at digitalmars.com
Sun Jun 26 21:00:24 PDT 2011



On 6/26/2011 8:50 PM, Andrei Alexandrescu wrote:
> On 6/26/11 10:34 PM, Walter Bright wrote:
>> I'm going to just back out the warning about pure functions with no effect.
>
> Why? I think that would be a mistake. Roll in any way you wish (after fixing 
> bugs and all), but do roll it it. There's absolutely never a good reason to 
> call a pure function and ignore its result, unless you just want to keep the 
> CPU warm.
>

Because with pure & nothrow inference, it breaks a lot of code, for example code 
like this:

void foo(int i)
{
     assert(i == 3);
}


More information about the dmd-internals mailing list