http://d.puremagic.com/issues/show_bug.cgi?id=5435

           Summary: Static foreach over tuple ignores type annotation
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: necrom...@gmail.com


--- Comment #0 from Max Klyga <necrom...@gmail.com> 2011-01-08 18:29:56 PST ---
import std.stdio; 

template Tuple(E...) { alias E Tuple; } 
enum Type { A, B, C };
alias Tuple!(Type.A, Type.B, Type.C, "foo", 3.0) tuple; 

void main() {
  foreach (Type foo; tuple)
    writeln(foo);
  foreach (string foo; tuple)
    writeln(foo);
  foreach (int foo; tuple)
    writeln(foo);
}
---------

This code compiles and runs without errors, printing every element of tuple.

Should the compiler reject static foreach with explicit type annotations ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to