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

           Summary: Duplicate error message on compile-time out of bounds
                    array index
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: yebbl...@gmail.com


--- Comment #0 from yebblies <yebbl...@gmail.com> 2011-06-09 19:55:43 PDT ---
void foo( T... )( T values ) {
    int[ T.length - 1 ] a;
    foreach ( i, v; values ) {
        a[ i ] = [0, 1][i];
    }
}

void main( ) {
    foo( 1, 2, 3 );
}

Prints:
testx.d(4): Error: array index 2 is out of bounds a[0 .. 2]
testx.d(4): Error: array index 2 is out of bounds [0,1][0 .. 2]
testx.d(4): Error: array index 2 is out of bounds a[0 .. 2]
testx.d(4): Error: array index 2 is out of bounds [0,1][0 .. 2]
testx.d(9): Error: template instance testx.foo!(int,int,int) error
instantiating

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

Reply via email to