https://issues.dlang.org/show_bug.cgi?id=24024

          Issue ID: 24024
           Summary: cannot pass class this to ref class
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: bugzi...@digitalmars.com

class C
{
    void mem()
    {
        foo(this); // fails
    }
}

void foo(ref C);

void test()
{
    C c;
    foo(c); // passes
}
-----------
test.d(5): Error: function `test.foo(ref C)` is not callable using argument
types `(C)`
test.d(5):        cannot pass rvalue argument `this` of type `test.C` to
parameter `ref C`

--

Reply via email to