Bug 12881 – Cannot declare a function in foreach over tuple

Status
RESOLVED
Resolution
DUPLICATE
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-09T09:36:00Z
Last change time
2014-06-09T13:20:09Z
Assigned to
nobody
Creator
temtaime

Comments

Comment #0 by temtaime — 2014-06-09T09:36:19Z
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
Comment #1 by yebblies — 2014-06-09T13:20:09Z
*** This issue has been marked as a duplicate of issue 4699 ***