What's the replacement for this array initialization: "ubyte[4096] window =0;"

Marco Leise Marco.Leise at gmx.de
Thu Feb 21 20:34:12 PST 2013


Am Thu, 21 Feb 2013 20:26:56 -0800
schrieb Ali Çehreli <acehreli at yahoo.com>:

> On 02/21/2013 08:10 PM, Marco Leise wrote:
>  >    struct ExpandData
>  >    {
>  >      /// Last seen bytes during expansion.
>  >      ubyte[4096] window = 0;
>  >      ...
>  >    }
>  >
>  >
>  > I noticed in 2.062 this code doesn't work anymore. The
>  > compiler still does the initial type conversion of 0 from int
>  > to ubyte, but the assignment fails with:
>  >
>  >    cannot implicitly convert expression (cast(ubyte)0u) of type
>  >    ubyte to ubyte[4096LU]
> 
> There must be something else. The same code compiles with the released 
> dmd 2.062 here. Are you using the latest dmd at github?
> 
> Ali

You are right, it compiles in isolated cases. By the looks of
the error message I didn't imagine it would depend on any
surrounding code. So it is a regression of unknown source :)

-- 
Marco



More information about the Digitalmars-d-learn mailing list