Re:Ruminations on D: An Interview with Walter Bright
by WalterBright on Tuesday August 30, 2016 @04:01PM
(#12393378)
Add '@safe' to main()'s declaration and it will no longer compile.
[ Parent
| on HN ]
Re:Ruminations on D: An Interview with Walter Bright
by notriddle on Wednesday August 31, 2016 @12:08PM
(#12399324)
import std.stdio;
@safe int f() {
int* x = new int(6);
delete x; // !!
return *x; // !!!!
}
@safe void main() {
writeln(f());
}
Re:Ruminations on D: An Interview with Walter Bright
by nialv7 on Wednesday August 31, 2016 @07:46PM
(#12402297)
'delete' is in the process of being deprecated: https://dlang.org/deprecate.html#delete