Thread overview
[Issue 6139] New: Duplicate error message on compile-time out of bounds array index
Jun 10, 2011
yebblies
Jul 01, 2011
yebblies
Oct 09, 2011
Walter Bright
June 10, 2011
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: nobody@puremagic.com
        ReportedBy: yebblies@gmail.com


--- Comment #0 from yebblies <yebblies@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: -------
July 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6139


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Severity|normal                      |trivial


--- Comment #1 from yebblies <yebblies@gmail.com> 2011-07-01 20:48:49 EST ---
https://github.com/D-Programming-Language/dmd/pull/187

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 09, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6139


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-10-08 23:41:31 PDT ---
https://github.com/D-Programming-Language/dmd/commit/60170445584861ec7fd9a93fc2e80863e59dace0

https://github.com/D-Programming-Language/dmd/commit/ca3923f9cb8f8c94e5209e00cab78813b7f363e9

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