https://issues.dlang.org/show_bug.cgi?id=15026

anoneu...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anoneu...@gmail.com

--- Comment #2 from anoneu...@gmail.com ---
The first example doesn't look to me like it should compile. Is it not
equivalent to this?

void test()
{
    (cast(int[]) null) = 2;
}

The second example works if you use opIndexAssign instead of opSlice:

struct Foo
{
    int[] opIndexAssign(int v)
    {
        return null;
    }
}

void test()
{
    Foo foo;
    foo[] = 2;
}

--

Reply via email to