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

Nick Treleaven <[email protected]> changed:

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

--- Comment #5 from Nick Treleaven <[email protected]> ---
(In reply to monarchdodra from comment #2)
> I thought about it some more, and there *are* case where you can slice an
> rvalue static array, provided you've "used" it by the end of the expression.
...
>     enum int[3] ints = [1, 2, 3];
>     auto s = sum(ints);
...
> - Do we find some way to detect *only* the "rvalue static array to dynamic
> array assignment" case?

Your original example is always wrong:

    int[1] foo();
    int[] a = foo();

Slicing a returned static array should be disallowed by the compiler. Should we
rename this issue or file a new one for just this?

--

Reply via email to