struct AB
{
        int a;
        int b;
        int [] numbers;
}

int main()
{
        int a = 300;
        const int [] numbers = new int[2];
        const AB c = {a,20, numbers};           // line 66
    writeln(c);
        return 0;
}

----------------------------
-debug
-unittest

src/main.d(66): Error: cannot implicitly convert expression (numbers) of type const(int[]) to int[]

---------------------------


const AB c;

        typeof(c.a)     is  const(int);
        typeof(c.numbers) is const(int []);


Shouldn't the code above accept the const(int [])   ?

Reply via email to