http://d.puremagic.com/issues/show_bug.cgi?id=6883
Summary: Array static bounds tests with $ too Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: diagnostic Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2011-11-02 17:12:14 PDT --- D2 code: void main() { int[5] x; x[x.length] = 1; enum size_t n = 2; x[x.length + n] = 2; } DMD 2.056 gives at compile-time: test.d(3): Error: array index 5 is out of bounds x[0 .. 5] test.d(5): Error: array index 7 is out of bounds x[0 .. 5] I'd like this similar program to give similar compile-time errors (with DMD 2.056 it gives no compile errors, and gives just run-time errors in debug mode): void main() { int[5] x; x[$] = 1; enum size_t n = 2; x[$ + n] = 2; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------