www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12304] New: `TypeInfo_AC` sometimes is called for array of interfaces

https://d.puremagic.com/issues/show_bug.cgi?id=12304

           Summary: `TypeInfo_AC` sometimes is called for array of
                    interfaces
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2014-03-06
15:47:25 MSK ---
`TypeInfo_AC` is a `TypeInfo` sometimes (see Issue 12303) used for arrays of
classes or interfaces. But it isn't designed to work with interfaces, so we
have wrong code e.g. here:
---
interface I { }
class C: I { }

void main()
{
    I[] a = [new C];
    int[I[]] aa = [a : 0];
    assert(a in aa); // fails
}
---

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 06 2014