7004 – Iterating tuple with index which explicitly typed as size_t causes an error

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7004 - Iterating tuple with index which explicitly typed as size_t causes an error
Summary: Iterating tuple with index which explicitly typed as size_t causes an error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
Reported: 2011年11月25日 01:33 UTC by Kenji Hara
Modified: 2015年06月09日 05:11 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2011年11月25日 01:33:33 UTC
void f(A...)(A args)
{
 foreach (i, e; args){} // OK
 foreach (uint i, e; args){} // OK
 foreach (size_t i, e; args){} // NG
}
void main()
{
 f(1, 3.14);
}
Comment 1 Kenji Hara 2011年11月25日 01:44:29 UTC
D2 patch:
https://github.com/D-Programming-Language/dmd/pull/533 


AltStyle によって変換されたページ (->オリジナル) /