[Issue 4088] New: opEquals not called on interfaces
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 13 16:33:42 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4088
Summary: opEquals not called on interfaces
Product: D
Version: 2.041
Platform: Other
OS/Version: All
Status: NEW
Severity: blocker
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: schveiguy at yahoo.com
--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-04-13 16:33:39 PDT ---
Given an interface that defines opEquals, the compiler will prefer to call the
object.opEquals(Object, Object) on it. However, interfaces don't implicitly
cast to Objects thanks to COM.
example:
interface I
{
bool opEquals(I other);
}
bool foo(I i1, I i2)
{
return i1 == i2;
}
testopequals.d(8): Error: function object.opEquals (Object lhs, Object rhs) is
not callable using argument types (I,I)
testopequals.d(8): Error: cannot implicitly convert expression (i1) of type
testopequals.I to object.Object
testopequals.d(8): Error: cannot implicitly convert expression (i2) of type
testopequals.I to object.Object
And can someone add 2.042 and 2.043 to the version list? This is tested on
2.043.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list