<div dir="ltr">On Wed, Jul 30, 2008 at 3:06 AM, Frank Benoit <span dir="ltr"><<a href="mailto:keinfarbton@googlemail.com">keinfarbton@googlemail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
interface I {<br>
}<br>
class C : I {<br>
override int opEquals(Object o){<br>
writefln("opEquals");<br>
return true;<br>
}<br>
}<br>
<br>
void main(){<br>
I i1 = new C;<br>
I i2 = new C;<br>
bool a = ( i1 == i2 );<br>
writefln( "result %s", a );<br>
}<br>
<br>
prints<br>
result false<br>
<br>
This is highly unexpected.<br>
Sure one might understand that with the knowledge of interface/class incompatibility in D. But this shows once more, that D has a Bug here.<br>
<br>
<br>
<br>
</blockquote></div><br>What is the reason that COM interfaces need to pretend to be D interfaces in the first place? As opposed to some special COMInterface type. I can't really think of any situation where you would need to treat a COM interface and a regular interface the same way without knowing that one was a COM interface. Or at least in a way that it would matter. For instance you could write a template that takes either a COM interface or a D interface, but in that case you generally won't care what the thing is underneath.<br>
<br>Can someone enlighten me? I've never really been able to understand what problem is supposed to be solved by conflating D Interfaces and COM interfaces.<br><br>--bb<br></div>