Bug 11841 – More useful RangeError message

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-12-29T07:12:00Z
Last change time
2014-04-25T18:41:24Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs
See also
http://d.puremagic.com/issues/show_bug.cgi?id=10696, http://d.puremagic.com/issues/show_bug.cgi?id=6513

Comments

Comment #0 by bearophile_hugs — 2013-12-29T07:12:09Z
Wrong code: void main() { int[10] data; int i = 20; int j = 30; data[i .. j] = 0; } DMD 2.065alpha outputs: core.exception.RangeError@temp(5): Range violation But I'd like an error message like this: core.exception.RangeError@temp(5): Range violation (20..30 is out of 0..10) (Optional: if you want in -release -noboundscheck mode the first message without the bounds is enough, to keep the binary more light.)
Comment #1 by andrej.mitrovich — 2014-04-25T18:41:24Z
*** This issue has been marked as a duplicate of issue 6513 ***