[Issue 4979] Implementing an interface twice results in different a reference for each interface

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 6 10:31:30 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=4979

FeepingCreature <default_357-line at yahoo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #5 from FeepingCreature <default_357-line at yahoo.de> ---
No this is a genuine bug. See
https://dlang.org/spec/expression.html#identity_expressions

"For class objects, identity is defined as the object references are for the
same object."

I ia and ib are interface references, but they are the same object.

D must transform the interfaces into their class reference before comparing,
even if the type is the same; else, multiple implementation of the same
interface must be either merged or made illegal.

--


More information about the Digitalmars-d-bugs mailing list