[Issue 13934] New: Cannot pass 'this' to function by reference

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 4 11:30:33 PST 2015


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

          Issue ID: 13934
           Summary: Cannot pass 'this' to function by reference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: doob at me.com

The following code compiles with 2.066.1 but fails to compile with 2.067.0-b1:

void bar (ref Foo) {}

class Foo
{
    void foo()
    {
        bar(this);
    }
}


The errors message is:

main.d(7): Error: function main.bar (ref Foo _param_0) is not callable using
argument types (Foo)

--


More information about the Digitalmars-d-bugs mailing list