[Issue 6139] New: Duplicate error message on compile-time out of bounds array index
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 9 20:00:17 PDT 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 at puremagic.com
ReportedBy: yebblies at gmail.com
--- Comment #0 from yebblies <yebblies at 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: -------
More information about the Digitalmars-d-bugs
mailing list