Struct polymorphism?

Jacob Carlborg doob at me.com
Mon Oct 8 23:35:50 PDT 2012


On 2012-10-09 00:19, Era Scarecrow wrote:

>    I think this is a compiler bug. It complains about calling
> opDispatch, however it doesn't complain if you explicitly call 'this'.
> Should adding 'this' be required? I am using the -property switch so
> it's a little more strict, but that doesn't seem to change the results.
> I can't just start adding 'this' to all my function as outside normal
> functions/variables won't ever be seen.

As far as I understand it, opDispatch needs a receiver, i.e. this.foo() 
or obj.foo(). I asked the same question a while ago and got that answer, 
it's by design.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list