http://d.puremagic.com/issues/show_bug.cgi?id=8663

           Summary: AliasThis is not used in comparison
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: ASSIGNED
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: and...@metalanguage.com
        ReportedBy: szad...@gmail.com


--- Comment #0 from Robik <szad...@gmail.com> 2012-09-15 04:48:04 PDT ---
Demo: http://dpaste.dzfl.pl/72015697

Test case:
import std.stdio;

void main()
{
    C c = new C("foo");    
    writeln(c == "foo");
}

class C
{
    string v;

    // This does not work
    alias v this;

    this(string val) { v = val; }
}

Result:
testcase.d(8): Error: function object.Object.opEquals (Object lhs, Object rhs)
is not callable using argument types (string)
testcase.d(8): Error: expected 2 function arguments, not 1

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

Reply via email to