Bug 20422 – confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-11-29T13:11:41Z
Last change time
2020-07-20T00:36:24Z
Keywords
bootcamp, diagnostic
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2019-11-29T13:11:41Z
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.
Comment #1 by b2.temp — 2019-12-12T19:39:18Z
*** Issue 19010 has been marked as a duplicate of this issue. ***
Comment #2 by dlang-bot — 2020-07-18T13:59:11Z
@VladNastase created dlang/dmd pull request #11428 "Fixed issue 20422 - confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"" mentioning this issue:
- Solved issue 20422
https://github.com/dlang/dmd/pull/11428
Comment #3 by dlang-bot — 2020-07-20T00:36:24Z
dlang/dmd pull request #11428 "Fixed issue 20422 - confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"" was merged into master:
- 1233da41081191130efc76706942568646475c8d by Vlad Nastase:
Fix issue 20422 - confusing error "new can only create structs, dynamic arrays or class objects, not int[]'s"
https://github.com/dlang/dmd/pull/11428