[Issue 24450] New: apply VRP to foreach indices when array is of known length
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 24 16:41:46 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24450
Issue ID: 24450
Summary: apply VRP to foreach indices when array is of known
length
Product: D
Version: D2
Hardware: x86_64
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
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
--
More information about the Digitalmars-d-bugs
mailing list