Summary: Clarify whether this is a bug or a feature
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Simcha <> 2011-02-17 08:30:33 PST ---
The following code compiles in 64-bit mode and arguably shouldn't (but arguably

void main() {
    int[] foo;
    foreach(uint i, elem; foo) {}

The index variable into foo is technically a size_t, not a uint.  On the other
hand this is arguably a feature.  The idiomatic way to write a foreach loop is
with implicit variable typing.  The insertion of an explicit type is, IMHO,
equivalent to using an explicit cast, and therefore it arguably should compile.

Personally, I prefer this to be considered a feature rather than a bug, but
either way I think it's important that the spec be clarified, as I've used this
idiom in several places when porting code to 64-bit.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to