Re: Delegate type inferred as pure

2013-01-28 Thread cal
On Monday, 28 January 2013 at 10:44:22 UTC, qznc wrote: On Monday, 28 January 2013 at 03:16:24 UTC, cal wrote: Is the 'typeof((int a){return z;})' getting it wrong here? Do you really need the type? You could just use "auto". auto dg = (int a) {return z;}; Yeah this is reduced from somethin

Re: Delegate type inferred as pure

2013-01-28 Thread Kenji Hara
On Monday, 28 January 2013 at 03:16:24 UTC, cal wrote: This fails: void main() { int z; typeof((int a){return z;}) dg; dg = (int a) {return z;}; } Error: cannot implicitly convert expression (__lambda2) of type int delegate(int a) nothrow @safe to int delegate(int a) pure nothrow

Re: Delegate type inferred as pure

2013-01-28 Thread qznc
On Monday, 28 January 2013 at 03:16:24 UTC, cal wrote: This fails: void main() { int z; typeof((int a){return z;}) dg; dg = (int a) {return z;}; } Error: cannot implicitly convert expression (__lambda2) of type int delegate(int a) nothrow @safe to int delegate(int a) pure nothrow

Delegate type inferred as pure

2013-01-27 Thread cal
This fails: void main() { int z; typeof((int a){return z;}) dg; dg = (int a) {return z;}; } Error: cannot implicitly convert expression (__lambda2) of type int delegate(int a) nothrow @safe to int delegate(int a) pure nothrow @safe But I can't make the delegate pure: dg = (int a)