I think it's because each lambda litteral is treated unique. can dmd be changed to recognize identical lambda litterals as identical? Is there any particular issue making that difficult? it already recognizes identical string literals as identical
On Mon, Jun 24, 2013 at 7:45 PM, cal <[email protected]> wrote: > Is it by design that the code below does not compile? > > import std.algorithm, std.range; > > void main() { > typeof(iota(10).map!(a=>a)) x = iota(10).map!(a=>a); > } > > Error message (DMD git-latest on DPaste): > Error: constructor f755.main.MapResult!(__**lambda2, > Result).MapResult.this (Result input) is not callable using argument types > (MapResult!(__lambda4, Result)) > Error: cannot implicitly convert expression (map(iota(10))) of type > MapResult!(__lambda4, Result) to Result >
