opDispatch with implicit receiver

Jacob Carlborg doob at me.com
Thu Aug 23 08:30:15 PDT 2012


Is it supposed to be possible to use opDispatch with an implicit 
receiver? For example:

class Foo
{
     this ()
     {
         foo(3);
     }
     void opDispatch (string name) (int value) {}
}

The above code will fail to compile with the following message:

Error: undefined identifier foo, did you mean class Foo?

If I prepend the call to "foo" with an explicit receiver, i.e. 
"this.foo(3);" the it compiles without errors.

DMD 2.060.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list