[Issue 21699] New: Duplicate error for index out of bounds at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 10 18:16:55 UTC 2021


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

          Issue ID: 21699
           Summary: Duplicate error for index out of bounds at compile
                    time
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: razvan.nitu1305 at gmail.com

void main()
{
     int[1] a;
     a[1] = 9;
}

Output:

onlineapp.d(4): Error: array index 1 is out of bounds a[0 .. 1]
onlineapp.d(4): Error: array index 1 is out of bounds a[0 .. 1]

This is a regression, but I don't know the version since run.dlang.io somehow
misses the double message. I have used a more complex version of this code for
D Summer School and it used to work correctly.

--


More information about the Digitalmars-d-bugs mailing list