www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12881] New: Cannot declare a function in foreach over tuple

https://issues.dlang.org/show_bug.cgi?id=12881

          Issue ID: 12881
           Summary: Cannot declare a function in foreach over tuple
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: temtaime gmail.com

import std.typetuple;

void main() {
    foreach(i; TypeTuple!(1, 2)) {
        int foo() { return i; }
    }
}

Error: declaration foo is already defined in another scope in main

--
Jun 09 2014