Thread overview
[Issue 5068] New: opOpAssign fails when if()-constraint is used
Oct 17, 2010
Nick Sabalausky
Oct 17, 2010
Nick Sabalausky
Oct 17, 2010
Nick Sabalausky
October 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5068

           Summary: opOpAssign fails when if()-constraint is used
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: cbkbbejeap@mailinator.com


--- Comment #0 from Nick Sabalausky <cbkbbejeap@mailinator.com> 2010-10-17 00:27:26 PDT ---
class Foo
{
    Foo opOpAssign(string op)(Foo b) if(op=="~=")
    {
        return this;
    }
}
void main()
{
    Foo f = new Foo();

    // Error: cannot append type test.Foo to type test.Foo
    f ~= new Foo();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5068



--- Comment #1 from Nick Sabalausky <cbkbbejeap@mailinator.com> 2010-10-17 00:34:43 PDT ---
Nevermind, I apparently can't read the docs right. This is how it's supposed to be, and it does work right:

Foo opOpAssign(string op)(Foo b) if(op=="~")

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5068


Nick Sabalausky <cbkbbejeap@mailinator.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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