www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11443] New: Misleading error for mismatch overloaded operator if there are immutable members

https://d.puremagic.com/issues/show_bug.cgi?id=11443

           Summary: Misleading error for mismatch overloaded operator if
                    there are immutable members
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-05
16:51:47 MSK ---
---
struct S
{
    const int i;
    void opOpAssign(string op : "+")(int) { }
    void opOpAssign(string op : "~")(int) { }
}

void main()
{
    S s;
    s += ""; // Error: cannot modify struct s S with immutable members
    s ~= ""; // Error: cannot modify struct s S with immutable members
}
---

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 05 2013