D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 23167 - inaccurate diagnostic for internal tuple bound violation
Summary: inaccurate diagnostic for internal tuple bound violation
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: bootcamp, diagnostic, pull
Depends on:
Blocks:
 
Reported: 2022-06-07 09:05 UTC by basile-z
Modified: 2022-06-22 01:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2022-06-07 09:05:19 UTC
## test case

alias Seq(A...) = A;
alias E = Seq!(int)[1]; 

## output

> /tmp/temp_7F1A9ABD98B0.d:2:1: Error: tuple index 1 exceeds 1

## notes

1 does not exceeds 1, the diagnostic should use ">=" or "is over or equal"
Comment 1 basile-z 2022-06-07 09:50:04 UTC
smthg like

"index `%d` is over or equal to the element count `%d`"

would be better
Comment 2 Dlang Bot 2022-06-21 15:30:59 UTC
@dkorpel created dlang/dmd pull request #14235 "Fix 23167 - inaccurate diagnostic for internal tuple bound violation" fixing this issue:

- Fix 23167 - inaccurate diagnostic for internal tuple bound violation

https://github.com/dlang/dmd/pull/14235
Comment 3 Dlang Bot 2022-06-22 01:15:19 UTC
dlang/dmd pull request #14235 "Fix 23167 - inaccurate diagnostic for internal tuple bound violation" was merged into master:

- 3c1931ce8446724d370f3516da2d7c2cbbb70e3a by Dennis Korpel:
  Fix 23167 - inaccurate diagnostic for internal tuple bound violation

https://github.com/dlang/dmd/pull/14235