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

           Summary: [CTFE] Array op gives wrong result
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-08-16 13:49:05 PDT ---
T foo(T)() {
    T[1] a = [1];
    a[] += a[];
    return a[0];
}
static assert(foo!ulong() == 2); // error
static assert(foo!long() == 2); // error
void main() {
    assert(foo!ulong() == 2); // OK
    assert(foo!long() == 2); // OK
}


DMD gives:

test.d(6): Error: static assert  (1LU == 2LU) is false

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

Reply via email to