Re: Wrong const attribute?

2011-09-23 Thread Paolo Invernizzi
Thank you all very much. Paolo On Sep 22, 2011, at 7:12 PM, Jonathan M Davis wrote: > On Thursday, September 22, 2011 04:12 Paolo Invernizzi wrote: > > The error is a bit confusing but essentially correct. Bar has an immutable > member variable. Once it's been initialized, that immutable member

Re: Wrong const attribute?

2011-09-23 Thread Christophe
Paolo Invernizzi , dans le message (digitalmars.D.learn:29680), a écrit : > > --Apple-Mail-7--919646864 > Content-Transfer-Encoding: quoted-printable > Content-Type: text/plain; > charset=us-ascii > > Hi all,=20 > > I've found nothing on bugzilla for that, what I'm missing? Or it's a = >

Re: Wrong const attribute?

2011-09-22 Thread Jonathan M Davis
On Thursday, September 22, 2011 04:12 Paolo Invernizzi wrote: > Hi all, > > I've found nothing on bugzilla for that, what I'm missing? Or it's a bug? > (DMD 2.055) > > struct Bar { > immutable int i; > this(int j){ i = j; } > } > > struct Foo { > Bar bar; > } > > void main(){ > > auto b = Bar(

Wrong const attribute?

2011-09-22 Thread Paolo Invernizzi
Hi all, I've found nothing on bugzilla for that, what I'm missing? Or it's a bug? (DMD 2.055) struct Bar { immutable int i; this(int j){ i = j; } } struct Foo { Bar bar; } void main(){ auto b = Bar(1); auto f = Foo(); f.bar = Bar(2); // Error: can only initia