I think it's because each lambda litteral is treated unique.<div>can dmd be changed to recognize identical lambda litterals as identical? Is there any particular issue making that difficult?</div><div>it already recognizes identical string literals as identical</div>
<div><br></div><div><div><div><div class="gmail_quote">On Mon, Jun 24, 2013 at 7:45 PM, cal <span dir="ltr"><<a href="mailto:callumenator@gmail.com" target="_blank">callumenator@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is it by design that the code below does not compile?<br>
<br>
import std.algorithm, std.range;<br>
<br>
void main() {<br>
   typeof(iota(10).map!(a=>a)) x = iota(10).map!(a=>a); <br>
}<br>
<br>
Error message (DMD git-latest on DPaste):<br>
Error: constructor f755.main.MapResult!(__<u></u>lambda2, Result).MapResult.this (Result input) is not callable using argument types (MapResult!(__lambda4, Result))<br>
Error: cannot implicitly convert expression (map(iota(10))) of type MapResult!(__lambda4, Result) to Result<br>
</blockquote></div><br></div></div></div>