[Issue 7470] opEquals for interfaces
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 9 07:36:49 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7470
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-02-09 07:36:48 PST ---
The original test case was that I could not compare two interfaces in the way
you say, yes. But you can compare two interfaces via Object:
interface I
{
}
class C : I
{
}
void main()
{
I i1 = new C, i2 = new C;
assert(i1 == i2); // should work now, did not work before
}
Prior to the fix, you could not compare two interfaces under *any
circumstances*. This at least allows interfaces to pull in Object's method for
opEquals.
What you are asking for is for interfaces (and by extension objects) to be
comparable to other objects using a derived type, which I think could be a
useful addition, but complex in implementation. You don't want to get into a
situation where two objects compare differently depending on the static type
used.
--
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