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

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from [email protected] ---
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