Bug 22198 – Compile time bounds checking for static arrays

Status
REOPENED
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2021-08-11T07:26:26Z
Last change time
2024-12-13T19:18:01Z
Keywords
pull, trivial
Assigned to
No Owner
Creator
Tejas_Garhewal
Moved to GitHub: dmd#19972 →

Comments

Comment #0 by scienticman — 2021-08-11T07:26:26Z
The following code fails to error out at compile time: void main(){ int[10] a; auto b = a[0..20];//mistake } The error is instead: [email protected](3): Range violation ---------------- ??:? _d_arrayboundsp [0x555bdc2b6c29] ./onlineapp.d:3 _Dmain [0x555bdc2b6b86] This can easily be caught at compile time, please do so. Thank you for your time!
Comment #1 by dlang-bot — 2021-10-14T17:32:35Z
@lucica28 created dlang/dmd pull request #13169 "Slice check bounds" fixing this issue: - Fix Issue 22198 - Fix Issue 22198 https://github.com/dlang/dmd/pull/13169
Comment #2 by dlang-bot — 2021-11-11T00:53:31Z
dlang/dmd pull request #13169 "Fix Issue 22198 - Compile time bounds checking for static arrays" was merged into master: - 15d3eb63bcd018095adb6236151cc1c199cca51e by Lucian Danescu: Fix Issue 22198 - db40ebdbe8e146ef55acac49e18655149991a337 by Lucian Danescu: Fix Issue 22198 https://github.com/dlang/dmd/pull/13169
Comment #3 by dlang-bot — 2022-12-21T09:18:26Z
dlang/dmd pull request #14722 "fix Issue 22646 - [REG2.099] CT bounds checking ignores short circuit evaluation" was merged into stable: - 4571cbcf7c2c36ee835d1e42a4f55e18d9b6168e by Iain Buclaw: revert Issue 22198 - Compile time bounds checking for static arrays https://github.com/dlang/dmd/pull/14722
Comment #4 by ibuclaw — 2022-12-21T09:33:58Z
Comment #5 by dlang-bot — 2023-01-01T05:29:32Z
@ibuclaw created dlang/dmd pull request #14765 "merge stable" mentioning this issue: - revert Issue 22198 - Compile time bounds checking for static arrays https://github.com/dlang/dmd/pull/14765
Comment #6 by dlang-bot — 2023-01-01T06:25:04Z
dlang/dmd pull request #14765 "merge stable" was merged into master: - 37533528ef4984dab2b70fbca891a00c8e97e73b by Iain Buclaw: revert Issue 22198 - Compile time bounds checking for static arrays https://github.com/dlang/dmd/pull/14765
Comment #7 by dlang-bot — 2023-10-04T15:48:32Z
@Mai-Lapyst created dlang/dmd pull request #15650 "Fix issue 22198 - Compile time bounds checking for static arrays" fixing this issue: - Fix issue 22198 - Compile time bounds checking for static arrays https://github.com/dlang/dmd/pull/15650
Comment #8 by robert.schadek — 2024-12-13T19:18:01Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19972 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB