www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9246] New: safe struct with dtor doesn't generate safe opAssign

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9246

           Summary: safe struct with dtor doesn't generate safe opAssign
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: overcheck gmail.com


--- Comment #0 from Shan-Yung Yang <overcheck gmail.com> 2012-12-31 11:03:04
PST ---
 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'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 31 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9246


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim maxim-fomin.ru


--- Comment #1 from Maxim Fomin <maxim maxim-fomin.ru> 2013-01-01 10:20:02 PST
---
Same problem was discussed here:
http://forum.dlang.org/thread/ckgieyydkrzyzayormby forum.dlang.org

The problem is that default opAssign is not deduced to be pure. It seems that
dtors also cannot be marked as pure.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2013