Bug 11210 – -inline rejects valid code with captured AA

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-09T12:33:00Z
Last change time
2013-10-10T04:59:50Z
Keywords
rejects-valid
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-10-09T12:33:20Z
Dmd rejects the following valid code as soon as it is compiled with -inline import std.stdio; import std.range; import std.algorithm : map; import std.string; import std.typecons; void main(string[] args) { auto content = "one two three"; uint[string] counts; auto result = splitter(content) .map!(a => tuple(a, counts[a])); writefln("%s", result); }
Comment #1 by code — 2013-10-09T12:35:04Z
The error message is: Error: function D main is a nested function and cannot be accessed from std.format.formatRange!(LockingTextW riter, MapResult!(__lambda2, SplitterResult!(isWhite, string)), char).formatRange
Comment #2 by k.hara.pg — 2013-10-10T04:59:50Z
*** This issue has been marked as a duplicate of issue 4841 ***