[dmd-beta] D 1.074 and 2.059 betas

Nick Sabalausky bus_dmdbeta at semitwist.com
Fri Apr 6 00:10:15 PDT 2012


From: "Nick Sabalausky" <bus_dmdbeta at semitwist.com>
> From: "Nick Sabalausky" <bus_dmdbeta at semitwist.com>
>> From: "Nick Sabalausky" <bus_dmdbeta at semitwist.com>
>>> Was something changed with struct opCmp, or its signature, or "const" 
>>> params? Because I'm getting some "wrong argument type" errors comparing 
>>> some structs that use opCmp. I'll try to dig further into it and get a 
>>> test case...
>>>
>>
>>
>> Regression(2.059 Beta): struct opEquals broken
>> http://d.puremagic.com/issues/show_bug.cgi?id=7833
>>
>
> Ok, a reply in there mentioned that's not actually a bug. But, the 
> changelog *really* should state prominently under "changed features" that:
>
> 1. Struct literals are no longer lvalues.
>
> and
>
> 2. Things like opCmp/opEquals/etc in a struct now need an overload with 
> non-const non-ref params in order to continue working with struct 
> literals.
>
> Maybe I'm biased since I ran head-first into it, but I'm betting that'll 
> confuse the crap out of many people if it's not clearly mentioned under 
> "changed features".
>
> So I've renamed the issue:
>
> [2.059 Beta] Changelog should clearly mention struct 
> literal/opCmp/opEquals changes
> http://d.puremagic.com/issues/show_bug.cgi?id=7833
>

See, now here's a problem though:

I add a non-ref non-const overload to those functions to make them work with 
struct literals on 2.059, and it works. But then 2.058 bitches it doesn't 
know which overload to use. I could do a static if on the compiler version, 
but that's DMD-specific - what about LDC and GDC?

I'm not necessarily saying that struct literals should be lvalues, but how 
am I supposed to reasonably make a program work on both 2.058 and 2.059?



More information about the dmd-beta mailing list