[dmd-beta] Fighting with 2.059 and not quite winning

Vladimir Panteleev thecybershadow.lists at gmail.com
Sat Apr 7 16:15:42 PDT 2012


On Sun, 08 Apr 2012 00:18:41 +0300, Vladimir Panteleev
<thecybershadow.lists at gmail.com> wrote:

> I've hit the mysterious opEquals problem again (this time with nothrow  
> instead of pure). I'm going to try minimizing my codebase and find the  
> cause.

I found the problem. The cause is that Object's opEquals is not nothrow,
another chicken-and-egg problem.

class C
{
	override bool opEquals(Object o) const nothrow
	{
		return true;
	}
}

struct S
{
	C o;

	bool opEquals(ref const S s) const nothrow
	{
		return o == s.o;
	}
}

What's even worse, is that overriding Object's opEquals with a nothrow
implementation still causes the error. I guess that's because a==b calls
the free opEquals function from object.d, which is not nothrow.

-- 
Best regards,
    Vladimir                            mailto:vladimir at thecybershadow.net


More information about the dmd-beta mailing list