[Issue 11178] New: Class may implement same interface multiple times with different interface pointers, breaking (a is b) semantics
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 5 16:27:13 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11178
Summary: Class may implement same interface multiple times with
different interface pointers, breaking (a is b)
semantics
Product: D
Version: D1 & D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: default_357-line at yahoo.de
--- Comment #0 from FeepingCreature <default_357-line at yahoo.de> 2013-10-05 16:27:12 PDT ---
Consider https://gist.github.com/6847299 . The errant behavior goes away if you
remove the I2 inheritance from C2, indicating that C2 implements I2 _twice_
with different interface pointers. This leads to hilariously hard-to-find
errors, since one generally assumes that casting two objects to the same
interface makes them is-comparable if they're the same object. The second I2 in
C2 should either be made illegal or silently ignored.
--
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