[Issue 5636] New: Array ops broken for comparisons

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 21 14:15:43 PST 2011


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

           Summary: Array ops broken for comparisons
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2011-02-21 14:13:02 PST ---
void main( ) {
    auto a = [1,2,3,4,5];
    auto b = [5,4,3,2,1];

    bool[] c = new bool[a.length];
    foreach ( i, ref e; c ) {
        e = a[i] < b[i];
    }
    assert( c == [true, true, false, false, false] );

    c[] = a[] < b[];
    assert( c != [true, true, false, false, false] );
}

One would believe the two results should be equal, but they're not.

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