http://d.puremagic.com/issues/show_bug.cgi?id=4665


Andrej Mitrovic <andrej.mitrov...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrov...@gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2010-08-29 
18:18:53 PDT ---
It does seem to be a delegate after all. If you try to evaluate it right there
it shows (notice the parantheses after the lambda definition):

import std.algorithm: map;

void main() 
{
    int n = 2;
    map!( (double x){ return x * n; }() )([1.0, 2.0]);
}

Errors:

test.d(10): Error: expected 1 function arguments, not 0
test.d(10): Error: cannot evaluate delegate double(double x)
{
return x * cast(double)n;
}
() at compile time


This seems like a compiler bug. If you use a string instead, then it will work:

import std.algorithm: map;

void main() 
{
    string n = "2";
    map!( (string x){ return x ~ n; } )(["1.0", "2.0"]);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to