digitalmars.D.bugs - [Issue 17505] New: [REG2.075] safe constructor requires the
- via Digitalmars-d-bugs (34/34) Jun 14 2017 https://issues.dlang.org/show_bug.cgi?id=17505
https://issues.dlang.org/show_bug.cgi?id=17505 Issue ID: 17505 Summary: [REG2.075] safe constructor requires the deconstructor to be safe as well Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: regression Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: greensunny12 gmail.com cat > main.d << CODE struct Array { int[] _payload; ~this() { import core.stdc.stdlib : free; free(_payload.ptr); } } class Scanner { Array arr; this() safe {} } CODE $ dmd -main main.d(14): Error: safe constructor 'main.Scanner.this' cannot call system destructor 'main.Scanner.~this' --
Jun 14 2017