www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7032] New: OpAssign is not called when this(this) is disabled


           Summary: OpAssign is not called when this(this) is disabled
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: deadalnix gmail.com

As of

If we disable this(this) in a struct, the opAssign member function should be
used if it exists. Here is a sample code :

module fail2;

struct Fail {

    ref Fail opAssign(ref const Fail t) {
        return this;

int main(string[] argv) {
    Fail a;
    Fail b = a; // Error: struct fail2.Fail is not copyable because it is
annotated with  disable

    return 0;

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 29 2011