D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14070 - Letting compiler determine length for fixed-length arrays in foreach
Summary: Letting compiler determine length for fixed-length arrays in foreach
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-28 14:45 UTC by bearophile_hugs
Modified: 2024-12-13 18:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2015-01-28 14:45:27 UTC
Related to Issue 481

Given the recent improvements for type inference for arrays (https://github.com/D-Programming-Language/dmd/pull/3615 ), I think it can be handy to also support:

void main() {
    int[2][] m = [[1, 2], [3, 4], [5, 6]];
    foreach (auto[2] a; m) {}
    foreach (int[$] a; m) {}
}
Comment 1 dlangBugzillaToGithub 2024-12-13 18:39:38 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18939

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB