Re: Union Initialization

2018-01-30 Thread Ali Çehreli via Digitalmars-d-learn
On 01/30/2018 07:33 PM, Rubn wrote: Is there any way to initialize an array of unions with more than just the first union type? struct A { float a; } struct B { uint b; } union Test {     A a;     B b; } Test[2] test = [     Test(A(1.0f)),     Test(B(10)), // ERROR ]; AFAIK there's n

Union Initialization

2018-01-30 Thread Rubn via Digitalmars-d-learn
Is there any way to initialize an array of unions with more than just the first union type? struct A { float a; } struct B { uint b; } union Test { A a; B b; } Test[2] test = [ Test(A(1.0f)), Test(B(10)), // ERROR ]; AFAIK there's no way to specify to use D with an initial

Re: D1: Error: duplicate union initialization for size

2014-09-02 Thread jicman via Digitalmars-d-learn
On Monday, 1 September 2014 at 15:44:50 UTC, Dicebot wrote: On Sunday, 31 August 2014 at 03:06:48 UTC, Dicebot wrote: My guess is that it hasn't been ported to the D1 compiler yet. Dicebot or any other people who work for Sociomantic should be most helpful. At this point, I recommend that you

Re: D1: Error: duplicate union initialization for size

2014-09-01 Thread Dicebot via Digitalmars-d-learn
On Sunday, 31 August 2014 at 03:06:48 UTC, Dicebot wrote: My guess is that it hasn't been ported to the D1 compiler yet. Dicebot or any other people who work for Sociomantic should be most helpful. At this point, I recommend that you ask on the main D forum. Ali I have not encountered such

Re: D1: Error: duplicate union initialization for size

2014-08-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-08-31 04:53, Ali Çehreli wrote: On 08/30/2014 06:05 PM, jicman wrote: > Really is or how one can fix it? This is the only time that I have > found myself without answers with D. Strange. Maybe folks are not that > into D1, but D1 was before D2. Any thoughts would be greatly > app

Re: D1: Error: duplicate union initialization for size

2014-08-30 Thread Dicebot via Digitalmars-d-learn
On Sunday, 31 August 2014 at 02:53:35 UTC, Ali Çehreli wrote: On 08/30/2014 06:05 PM, jicman wrote: > Really is or how one can fix it? This is the only time that I have > found myself without answers with D. Strange. Maybe folks are not that > into D1, but D1 was before D2. Any thoughts woul

Re: D1: Error: duplicate union initialization for size

2014-08-30 Thread Ali Çehreli via Digitalmars-d-learn
On 08/30/2014 06:05 PM, jicman wrote: > Really is or how one can fix it? This is the only time that I have > found myself without answers with D. Strange. Maybe folks are not that > into D1, but D1 was before D2. Any thoughts would be greatly > appreciated. Even from Walter. :-) Thanks. I

Re: D1: Error: duplicate union initialization for size

2014-08-30 Thread jicman via Digitalmars-d-learn
what's going on. So, I guess no one in this forum knows what the D1 error, D1: Error: duplicate union initialization for size Really is or how one can fix it? This is the only time that I have found myself without answers with D. Strange. Maybe folks are not that into D1, but D1 was b

Re: D1: Error: duplicate union initialization for size

2014-08-27 Thread Jacob Carlborg via Digitalmars-d-learn
On 27/08/14 23:48, jicman wrote: On Wednesday, 27 August 2014 at 06:20:24 UTC, Jacob Carlborg wrote: On 23/08/14 19:50, jicman wrote: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Does the following make any difference? con

Re: D1: Error: duplicate union initialization for size

2014-08-27 Thread jicman via Digitalmars-d-learn
initialization for size c:\D\import\dfl\control.d(7954): Error: duplicate union initialization for size c:\D\import\dfl\control.d(7954): Error: duplicate union initialization for size c:\D\import\dfl\control.d(7954): Error: duplicate union initialization for size Line 7635: const Size DEFAULT_SCALE = Size

Re: D1: Error: duplicate union initialization for size

2014-08-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 27/08/14 04:38, jicman wrote: I wish I knew. :-( Above, in this same post I pasted all lines that had Size and right below it all lines that had size. These are all the places where Size is found. If you can tell me which one you think it is, I can grab that piece of the code. I found it

Re: D1: Error: duplicate union initialization for size

2014-08-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 23/08/14 19:50, jicman wrote: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Does the following make any difference? const Size DEFAULT_SCAL = Size(5, 13) -- /Jacob Carlborg

Re: D1: Error: duplicate union initialization for size

2014-08-26 Thread jicman via Digitalmars-d-learn
On Tuesday, 26 August 2014 at 06:36:59 UTC, Jacob Carlborg wrote: On 26/08/14 00:57, jicman wrote: Ok, let's try something simpler... Where can I find the D1 v1.076 compiler error meaning of, Error: duplicate union initialization for size for this line, const Size DEFAULT_SCALE

Re: D1: Error: duplicate union initialization for size

2014-08-26 Thread Ali Çehreli via Digitalmars-d-learn
On 08/25/2014 11:36 PM, Jacob Carlborg wrote: On 26/08/14 00:57, jicman wrote: Ok, let's try something simpler... Where can I find the D1 v1.076 compiler error meaning of, Error: duplicate union initialization for size for this line, const Size DEFAULT_SCALE = { 5, 13 }; How doe

Re: D1: Error: duplicate union initialization for size

2014-08-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 26/08/14 00:57, jicman wrote: Ok, let's try something simpler... Where can I find the D1 v1.076 compiler error meaning of, Error: duplicate union initialization for size for this line, const Size DEFAULT_SCALE = { 5, 13 }; How does the code for Size look like? -- /Jacob Carlborg

Re: D1: Error: duplicate union initialization for size

2014-08-25 Thread jicman via Digitalmars-d-learn
Ok, let's try something simpler... Where can I find the D1 v1.076 compiler error meaning of, Error: duplicate union initialization for size for this line, const Size DEFAULT_SCALE = { 5, 13 }; thanks.

Re: D1: Error: duplicate union initialization for size

2014-08-24 Thread jicman via Digitalmars-d-learn
On Sunday, 24 August 2014 at 21:54:57 UTC, jicman wrote: On Sunday, 24 August 2014 at 10:52:38 UTC, bearophile wrote: jicman: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Can you show the (reduced) definition of Size and D

Re: D1: Error: duplicate union initialization for size

2014-08-24 Thread jicman via Digitalmars-d-learn
On Sunday, 24 August 2014 at 10:52:38 UTC, bearophile wrote: jicman: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Can you show the (reduced) definition of Size and DEFAULT_SCALE? Even better to show a minimized self-contain

Re: D1: Error: duplicate union initialization for size

2014-08-24 Thread bearophile via Digitalmars-d-learn
jicman: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Can you show the (reduced) definition of Size and DEFAULT_SCALE? Even better to show a minimized self-contained program that has the problem. Bye, bearophile

Re: D1: Error: duplicate union initialization for size

2014-08-24 Thread Kagamin via Digitalmars-d-learn
Mybe, some fields in Size overlap. If you look at it, you may understand, what happens.

D1: Error: duplicate union initialization for size

2014-08-23 Thread jicman via Digitalmars-d-learn
compiling the code: c:\D\dmd1.76\dmd\import\dfl\control.d(7634): Error: duplicate union initialization for size This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. josé