On 10/05/2012 04:09 PM, Ali Çehreli wrote:
...

This workaround makes the compiler happy:

void foo (inout(int)[] arr)
{
     auto a = (inout int) { auto b = arr[0]; };
}

But probably not what you want. :/

IIRC, inout has bugs and incomplete implementation. I think this should
be in the bug database.

Ali

The original behaviour is to be expected and the workaround exploits a compiler bug.

The correct way to get rid of the compile error is:

void foo(inout(int)[] arr){
    auto a = { const b = arr[0]; } // or int b = arr[0];
}

Reply via email to