Bug 8351 – Lambdas in 'static foreach' give errors

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-06T01:05:00Z
Last change time
2012-07-08T05:13:16Z
Assigned to
nobody
Creator
wfunction

Comments

Comment #0 by wfunction — 2012-07-06T01:05:05Z
module Test; import std.typetuple; void main() { foreach (i; TypeTuple!(1, 2, 3)) auto a = () => i; } Test.obj(Test) Offset 0029BH Record Type 00C3 Error 1: Previous Definition Different : _D4Test4mainFZv9__lambda1FNaNbNfZi Test.obj(Test) Offset 002B0H Record Type 00C3 Error 1: Previous Definition Different : _D4Test4mainFZv9__lambda1FNaNbNfZi
Comment #1 by timon.gehr — 2012-07-06T05:14:35Z
Presumably related to issue 8267
Comment #2 by yebblies — 2012-07-08T05:13:16Z
(In reply to comment #1) > Presumably related to issue 8267 Static foreach creates identically named but different lambdas in different anonymous scopes. This is related to issue 3031 (same thing with explicitly named symbols) *** This issue has been marked as a duplicate of issue 5655 ***