Expanding the horizons of D purity

Timon Gehr timon.gehr at gmx.ch
Thu Oct 31 14:13:46 PDT 2013


On 10/31/2013 10:10 PM, Timon Gehr wrote:
>
> void func(scope void delegate(int)pure immutable dg){
>      dg(1);
> }
>
> But DMD rejects this, which is blatantly wrong. It uses two different
> notions of purity for delegates obtained from member functions and for
> lambdas.

(Actually DMD 2.063+ accept the declaration but disallow calling it with 
a lambda function, but this is a minor change.)


More information about the Digitalmars-d mailing list