www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11186] New: Regression (2.061): Presence of Variant and const field invokes opAssign

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

           Summary: Regression (2.061): Presence of Variant and const
                    field invokes opAssign
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-10-06
13:24:21 PDT ---
-----
import std.variant;

struct S
{
    Variant v;
    const(bool) b;
}

class C
{
    this()
    {
        s = S.init;  // why is this calling opAssign?
    }

    S s;
}

void main() { }
-----

2.060:
$ dmd test.d
 
2.061: $ dmd test.d
 Error: can only initialize const member b inside constructor
2.062, 2.063, 2.064 (git-head): $ dmd test.d
 test.d(15): Error: function test.S.opAssign is not callable because it is
annotated with  disable
If *either* (or both of course) the variant or boolean fields are removed, it compiles fine. But for some reason when both are present, there's a compile error. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 06 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11186


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2013-10-14
20:53:54 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2665

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