[dmd-beta] D 2.062 beta

Nick Sabalausky bus_dmdbeta at semitwist.com
Sat Feb 9 15:07:50 PST 2013


On Fri, 8 Feb 2013 18:25:27 -0500
Nick Sabalausky <bus_dmdbeta at semitwist.com> wrote:
> 
> There's also another problem I have with a certain opCmp not working
> right (as of 2.061), but it might turn out to be the same problem, or
> my own fault, or something else entirely. not sure yet...

Ok, the problem I was having turned out to be this:

In my struct, I originally had this:

------------------------------------
bool opEquals(ref const Insensitive b) const {...}
int opCmp(ref const Insensitive b) const {...}
------------------------------------

Starting with 2.061, those silently failed to get called (when looking
up the struct as an AA key), and I had to change them to this:

------------------------------------
bool opEquals(const Insensitive b) const { return opEquals(b); }
bool opEquals(ref const Insensitive b) const {...}

int opCmp(const Insensitive b) const { return opCmp(b); }
int opCmp(ref const Insensitive b) const {...}
------------------------------------

Note that auto ref (as below) failed to work because it silently fails
to get called on all versions of DMD I tried (2.060, 2.061 and this
2.062 beta):

------------------------------------
bool opEquals()(auto ref const Insensitive b) const {...}
int opCmp()(auto ref const Insensitive b) const {...}
------------------------------------

It took me literally hours to figure all this out, largely because the
changelog for 2.061 appears to make no mention of any of it (unless it's
buried somewhere in bugzilla, but I couldn't find it when I looked
just now).

This is a perfect example of why the changelog needs to go back to
*not* being nearly-useless. That, and the constant NG posts of "How
the changelog's download link for the latest version, 2.062, is broken?"


More information about the dmd-beta mailing list