[Issue 17486] lazy parameters cannot be used in nothrow/@nogc functions
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jun 9 12:33:48 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17486
--- Comment #1 from Eyal <eyal at weka.io> ---
This also breaks purity type checking:
@safe:
import std.stdio:writeln;
void f(lazy int x) pure {
x();
}
unittest {
int g() {
writeln("impure func called by pure func!");
return 5;
}
auto xx = (() => g());
writeln("-> f");
f(xx());
writeln("<- f");
}
outputs:
-> f
impure func called by pure func!
<- f
--
More information about the Digitalmars-d-bugs
mailing list