Bug 19534 – Wrong error message "only one index allowed to index int"
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-12-31T21:30:55Z
Last change time
2020-03-21T03:56:34Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2018-12-31T21:30:55Z
```
auto a = [0, 100, 200][0, 1];
auto b = 200[0];
```
Yields:
Error: only one index allowed to index int[]
Error: only one index allowed to index int
The top error makes sense, but the bottom one does not: you can't index an int at all, but the error suggests I should use one index (which I already do).
@dkorpel updated dlang/dmd pull request #10075 "Fix Issue 19534 - Wrong error message "only one index allowed to index int"" fixing this issue:
- fix issue 19534 - improve error message for array expression
https://github.com/dlang/dmd/pull/10075
Comment #3 by dlang-bot — 2019-06-23T10:30:15Z
dlang/dmd pull request #10075 "Fix Issue 19534 - Wrong error message "only one index allowed to index int"" was merged into master:
- 16cd7d71c8d8bc2139c443a6b2c617b824478657 by dkorpel:
fix issue 19534 - improve error message for array expression
https://github.com/dlang/dmd/pull/10075