4 ms·
Add '@safe' to main()'s declaration and it will no longer compile.
by WalterBright 10y ago
Add '@safe' to main()'s declaration and it will no longer compile.
- deleted 10y ago[deleted]
- notriddle 10y agoimport std.stdio; @safe int f() { int* x = new int(6); delete x; // !! return *x; // !!!! } @safe void main() { writeln(f()); }
- nialv7 10y ago'delete' is in the process of being deprecated: https://dlang.org/deprecate.html#delete https://dlang.org/deprecate.html#delete