Bug 24450 – apply VRP to foreach indices when array is of known length

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2024-03-24T16:41:46Z
Last change time
2024-03-26T05:09:41Z
Keywords
pull
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2024-03-24T16:41:46Z
This: foreach (int i, color; [red, green, blue]) img.fillCircle(50 + i * 20, 30 + i * 10, 20 + i * 5, color); should not give an error about implicit conversion of 64 bit size_t to int, because the array's length is known to fit in an int. https://github.com/dlang/dmd/pull/8941#issuecomment-496306412
Comment #1 by dlang-bot — 2024-03-25T14:08:17Z
@ntrel created dlang/dmd pull request #16334 "Fix Bugzilla 24450 - apply VRP to foreach indices when array is of kn…" fixing this issue: - Fix Bugzilla 24450 - apply VRP to foreach indices when array is of known length https://github.com/dlang/dmd/pull/16334
Comment #2 by dlang-bot — 2024-03-26T05:09:41Z
dlang/dmd pull request #16334 "Fix Bugzilla 24450 - apply VRP to foreach indices when array is of kn…" was merged into master: - c63bb20c83b4452337ceff4d1bfc4ac25835935f by Nick Treleaven: Fix Bugzilla 24450 - apply VRP to foreach indices when array is of known length https://github.com/dlang/dmd/pull/16334