digitalmars.D.bugs - [Issue 2794] New: Compatibility between class and interface
- d-bugmail puremagic.com (30/30) Apr 03 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2794
- d-bugmail puremagic.com (8/8) Apr 03 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2794
- d-bugmail puremagic.com (12/12) Jun 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2794
http://d.puremagic.com/issues/show_bug.cgi?id=2794
Summary: Compatibility between class and interface
Product: D
Version: 1.042
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: benoit tionex.de
Object references and those to interfaces shall be compatible.
//-----------------------------------------------------
interface I {}
I i1 = getInstance();
I i2 = getAnotherInstance();
Object[] array;
// this does not compile, but it should:
bool res = (i1 == i2);
array ~= i1;
// instead this is atm needed:
bool res = (cast(Object)i1).opEquals( cast(Object) i2 );
array ~= cast(Object)i1;
//-----------------------------------------------------
That implies, each interface shall have the methods from Object.
Each interface shall be implicit castable to Object.
For the case, an interface is derived from IUnknown the compiler can handle
those interfaces special, and remove the compatibility.
--
Apr 03 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2794
benoit tionex.de changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|1.042 |2.026
I changed to D2 compiler.
--
Apr 03 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2794
yebblies <yebblies gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |yebblies gmail.com
Resolution| |DUPLICATE
*** This issue has been marked as a duplicate of issue 4088 ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 10 2011









d-bugmail puremagic.com 