[Issue 6513] New: More info in Range violation exception message?
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue Aug 16 13:56:47 PDT 2011
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=6513
           Summary: More info in Range violation exception message?
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-08-16 13:56:45 PDT ---
This is a wrong D2 program:
void main() {
    auto foo = new int[][](10, 10);
    int i = 2;
    foo[i][$ + 1] = 1;
}
It gives at run-time:
core.exception.RangeError at test(4): Range violation
But if possible I'd like a more decriptive message, that gives more
information, something like:
core.exception.RangeError at test(4): Range violation (array 'foo[2]', length=10,
index=11)
(The disadvantage of this error message is that the binary gets larger in
nonrelease mode. If this is too much overhead, then consider a similar message
in -debug compilation only).
-- 
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