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



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



---
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