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

           Summary: alias this and sort produce wrong code
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Simon <[email protected]> 2014-01-15 15:56:16 
PST ---
When I use alias this to overload the comparison operators on a struct, sort
gives wrong results on some inputs (dmd 2.64.2, 64bit Ubuntu). Minimal example
to reproduce:

struct S
{
    int i;
    alias i this;
}

void main(string[] args)
{
    auto arr = [S(1000),S(2000)];
    arr[].sort;
    assert(arr[0] < arr[1]);
}

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

Reply via email to