Bug 9246 – safe struct with dtor doesn't generate safe opAssign

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-31T11:03:00Z
Last change time
2014-09-18T10:50:26Z
Keywords
safe
Assigned to
nobody
Creator
overcheck

Comments

Comment #0 by overcheck — 2012-12-31T11:03:04Z
@safe struct S { ~this(){} // need dtor to reproduce } @safe void main(){ S s1, s2; s1 = s2; // error } Compiler message: safe function 'main' cannot call system function 'opAssign'
Comment #1 by maxim — 2013-01-01T10:20:02Z
Same problem was discussed here: http://forum.dlang.org/thread/[email protected] The problem is that default opAssign is not deduced to be pure. It seems that dtors also cannot be marked as pure.
Comment #2 by k.hara.pg — 2014-09-18T10:50:26Z
Fixed in 2.064. *** This issue has been marked as a duplicate of issue 10079 ***