http://d.puremagic.com/issues/show_bug.cgi?id=4312
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from [email protected] 2011-05-26 23:41:38 PDT --- (In reply to comment #3) > I can confirm that non-nested function literals now compile. (i.e. the > original > bug report) But nested function literals don't compile (DMD 2.053): > > void main(string[] args) { > int b; > writeln( (ReturnType!( function(int a){return a+b;} )).stringof ); > } > > Error: function hello.main.__funcliteral1 cannot access frame of function D > main > > Not too sure if this is a separate issue or not. This is expected. A function literal cannot form a closure. You need a delegate. -------------------------- void main() { int b; auto c = function(int a){return a+b;}; } -------------------------- x.d(6): Error: function x.main.__funcliteral1 cannot access frame of function D main -------------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
