[Issue 6942] lazy parameters can break purity
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Nov 13 04:55:00 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6942
--- Comment #1 from timon.gehr at gmx.ch 2011-11-13 04:54:18 PST ---
note that
int foo(int delegate() x) pure{
return x()+x();
}
void main(){
auto a=foo({return writeln("impure"),1;});
}
fails with
Error: pure function 'foo' cannot call impure delegate 'x'
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list