[Issue 20422] New: confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 29 13:11:41 UTC 2019


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

          Issue ID: 20422
           Summary: confusing error "new can only create structs, dynamic
                    arrays or class objects, not int[]'s"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

This code:
```
void main() {
    new int[];
}
```

Gives this error message:
"new can only create structs, dynamic arrays or class objects, not int[]'s

int[] is obviously a dynamic array, the real problem is that no length
parameter is given.

--


More information about the Digitalmars-d-bugs mailing list