Currently this code gets rejected:

const int[] a = [1];
void main() pure {
    auto y = a[0];
}


test2.d(3,14): Error: pure function 'D main' cannot access mutable static data 'a' test2.d(3,14): Error: pure function 'D main' cannot access mutable static data 'a'

But is this a good idea? Isn't it better to accept it?

Bye,
bearophile

Reply via email to