typeof map

Timothee Cour thelastmammoth at gmail.com
Mon Jun 24 21:25:26 PDT 2013


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 <callumenator at gmail.com> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20130624/df7b2d2e/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list