www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12943] New: Duplicated error message for out of bound array

https://issues.dlang.org/show_bug.cgi?id=12943

          Issue ID: 12943
           Summary: Duplicated error message for out of bound array index
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

void main() {
    int[5] arr;
    auto x = arr[7];
}


DMD 2.066alpha gives two error messages, where one is enough:

test.d(3,14): Error: array index 7 is out of bounds arr[0 .. 5]
test.d(3,14): Error: array index 7 is out of bounds arr[0 .. 5]

--
Jun 18 2014