[Issue 8533] New: Postfix and prefix declarations of static multidimensional arrays aren't equivalent
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 10 10:16:22 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8533
Summary: Postfix and prefix declarations of static
multidimensional arrays aren't equivalent
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: FatalError at trash-mail.com
--- Comment #0 from FatalError at trash-mail.com 2012-08-10 10:16:19 PDT ---
I found this in v2.059 and v2.060.
Consider these 2 programs:
Pre:
void main()
{
int m[3][2];
foreach(i;0..3)
{
m[0][i]=0;
m[1][i]=1;
}
}
Post:
void main()
{
int [3][2]m;
foreach(i;0..3)
{
m[0][i]=0;
m[1][i]=1;
}
}
They only differ in the declaration of m.
Pre throws a range violation, but Post does not. This is a bug, because the
documentation for rectangular arrays claims
int [3][2]m;
int m[3][2];
to be equivalent declarations.
--
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