[Issue 15367] New: array of delegates comparison fails

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Nov 20 04:04:02 PST 2015


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

          Issue ID: 15367
           Summary: array of delegates comparison fails
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: dmdtracker at supradigital.org

To my understanding the code below should work, however the assert fails.

module main;

void main()
{
    void a () {}
    void b () {}

    auto array  = [&b, &a];
    auto array2 = [&b, &a];

    for (auto i = 0; i < 2; i++)
        assert(array[i] == array2[i]);

    assert(array ==  array2); // Assert failure
}

--


More information about the Digitalmars-d-bugs mailing list