https://issues.dlang.org/show_bug.cgi?id=23136

Bolpat <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Bolpat <[email protected]> ---
To be honest, I find this worse:

```d
import std.stdio;

void main() @safe
{
    int delegate() immutable pure @safe[] dgList;
    foreach(int i; [0,1,2])
    {
        immutable b = i;
        dgList ~= () immutable pure @safe => b;
        writeln(dgList[$-1]());
    }
    writeln;
    foreach(dg; dgList) writeln(dg());
}
```

An immutable pure @safe delegate should never ever be able to return different
values for the same parameters (in particular: no parameters).

--

Reply via email to