[Issue 7783] New: compiler generated struct equality doesn't compare array fields

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 25 22:10:30 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7783

           Summary: compiler generated struct equality doesn't compare
                    array fields
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dawg at dawgfoto.de


--- Comment #0 from dawg at dawgfoto.de 2012-03-25 22:10:53 PDT ---
cat > bug.d << CODE
struct Foo
{
    string name;
    bool b;
}

void main()
{
    auto a = Foo("foobar".idup, true);
    auto b = Foo("foobar".idup, true);
    assert(a == b);
}
CODE

dmd -run bug

--------

The structures are compared bitwise which fails here.

-- 
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