Summary: pure function too pure
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

pure int fun(int d, int divisor)
    if (d < 0)
        d -= divisor - 1;
    return d / divisor;

This doesn't compile because d is assumed to be constant. It doesn't have to
because it's a private copy of the function. Beware when fixing this - any
indirectly-referenced data is not part of function's private state.


Reply via email to