<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, Apr 11, 2026 at 10:23 PM Nick Treleaven via Digitalmars-d-learn <<a href="mailto:digitalmars-d-learn@puremagic.com">digitalmars-d-learn@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Saturday, 11 April 2026 at 06:56:36 UTC, Danni Coy wrote:<br>
> On Sat, Apr 11, 2026 at 4:39 PM Danni Coy <<a href="mailto:danni.coy@gmail.com" target="_blank">danni.coy@gmail.com</a>><br>
>> ok with further investigation, linker errors come back as soon <br>
>> as I add the union into the struct.<br>
>><br>
>> eg<br>
>>   union u<br>
>>   {...<br>
>>   ...}<br>
>>   u event;<br>
>> }<br>
>><br>
>> why would my struct now no longer have an initializer?<br>
>><br>
><br>
> ok gets weirder - adding an int  to the beginning of the <br>
> anonymous union removes the linker problem.<br>
><br>
> union<br>
> {<br>
>      int _;<br>
>     EventA a;<br>
>     EventB b;<br>
> }<br>
><br>
> Is this a bug, or is there something I am missing?<br>
<br>
Can you give the definition of EventA please?<br></blockquote><div><br></div><div> struct EventA<br>{<br>    ulong timestamp;<br>    float x, y;<br>    ubyte clicks,button;<br>    bool down;<br>}</div></div></div>