Can't assign to static array in ctor?

kenji hara k.hara.pg at gmail.com
Mon Apr 9 19:03:55 PDT 2012


2012年4月10日10:53 H. S. Teoh <hsteoh at quickfur.ath.cx>:
> On Mon, Apr 09, 2012 at 09:42:25PM +0200, bearophile wrote:
>> H. S. Teoh:
>>
>> >     struct S {
>> >             const(int)[4] data;
>> >             this(const(int)[4] d) {
>> >                     data = d;       // this is line 4
>> >             }
>> >     }
>> >
>> >     void main() {
>> >             S s;
>> >     }
>>
>> I think this used to work (do you have an older DMD to verify it?).
>> So maybe this is regression.
> [...]
>
> I just checked out tag v2.054 of dmd from git, and the same error
> happens. I guess it's a bug that nobody ran into before?

It is a bug yet not fixed.
http://d.puremagic.com/issues/show_bug.cgi?id=6174

Kenji Hara


More information about the Digitalmars-d mailing list