http://d.puremagic.com/issues/show_bug.cgi?id=2832
Summary: pure function too pure Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzi...@digitalmars.com ReportedBy: and...@metalanguage.com 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. --