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

yebblies <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |WONTFIX

--- Comment #3 from yebblies <[email protected]> ---
(In reply to Don from comment #1)
> 
> Of course it fails. array is an enum, it can never change. That's the point
> of enum!
> 
> The confusing thing is that bringToFront compiles when passed a manifest
> constant.

The 'bug' is that you can have mutable array manifest constant.  The code
expands to:

bringToFront([1, 2, 3, 4][0 .. $-1], [1, 2, 3, 4][$-1 .. $]);

which is valid, because an array literal is a valid range.

The mutable manifest constant and implicit dup, are unfortunately working as
designed.

See issue 9953.

--

Reply via email to