dmd infers function closures impure if impure functions are defined within them. even if those are never called and can never be accessed outside of the closure.

Example :

int a;
void closure() pure {
  impure_function() {
    a++;
   }
}
t.d(4): Error: pure function 't.closure.impure_function' cannot access mutable static data 'a'

is this intended ?


Reply via email to