DIP 1021--Argument Ownership and Function Calls--Community Review Round 1
Elronnd
elronnd at elronnd.net
Tue Jul 16 21:25:13 UTC 2019
Will this be able to detect delegates which close over variables?
Consider this snippet (which, incidentally, also serves as a POC
for @safe since it compiles successfully under @safe):
byte bb; //must be global so its address can be taken
void foo(ref byte *b, void delegate() @safe fun) {
fun();
*b = 4;
}
void test() {
byte *s = &bb;
foo(s, {s = null;});
}
It seems like a bit of an intractable problem to detect.
More information about the Digitalmars-d
mailing list