Re: Two questions about assignments

2013-05-28 Thread bearophile
I will add it to Bugzilla then, if it's not already there. http://d.puremagic.com/issues/show_bug.cgi?id=10192 Bye, bearophile

Two questions about assignments

2013-05-27 Thread bearophile
Do you know if it's OK to accept x3 assignment and refuse the a2 assignment? struct Foo { immutable(char)[4] bar; } Foo x1 = { AA };// No error. immutable(char)[4] a1 = AA; // No error. void main() { Foo x2 = { AA };// No error. Foo x3 = Foo(AA); // No

Re: Two questions about assignments

2013-05-27 Thread Kenji Hara
On Monday, 27 May 2013 at 18:00:38 UTC, bearophile wrote: Do you know if it's OK to accept x3 assignment and refuse the a2 assignment? struct Foo { immutable(char)[4] bar; } Foo x1 = { AA };// No error. immutable(char)[4] a1 = AA; // No error. void main() { Foo x2 = { AA

Re: Two questions about assignments

2013-05-27 Thread bearophile
Kenji Hara: Thank you very much for your gentle and useful answers :-) struct Foo { immutable(char)[4] bar; } Foo x1 = { AA };// No error. immutable(char)[4] a1 = AA; // No error. void main() { Foo x2 = { AA };// No error. Foo x3 = Foo(AA); // No error.

Re: Two questions about assignments

2013-05-27 Thread Kenji Hara
On Tuesday, 28 May 2013 at 00:29:04 UTC, bearophile wrote: std.typecons.Tuple supports structural assignment before the change. The code also works with 2.062. I know it's not a regression. But you say: Named-field tuple should be a subtype of unnamed-field tuple. You can have sub-typing, or