Szymon Gatner:

const int[] a;
int[] b;

static this()
{
   b = [1];
   a = b;
}

Ant this code works? What is the point of const then if you can assign it to mutable slice?

It works, and I think it should work. Inside the (module) constructor the const state is handled differently.

Thank you for the example, safety0ff.

Bye,
bearophile

Reply via email to