[Issue 8113] alias this and opDispatch() don't forward opCall
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu May 17 23:02:31 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8113
--- Comment #6 from Kenji Hara <k.hara.pg at gmail.com> 2012-05-17 23:04:02 PDT ---
(In reply to comment #5)
> Thanks.
>
> Just wondering, why is the second one an 'enhancement'? Isn't opUnary just a
> member, which should also be opDispatch'ed?
Today these forwarding doesn't work at all.
struct S { void opDispatch(string op, A...)(A args){} }
void main() {
S s;
+s; // not converted to opDispatch!("opUnary", ...)
s + s; // not converted to opDispatch!("opBinary", ...)
s(); // not converted to opDispatch!("opCall", ...)
}
So I think this is an enhancement rather than a bug.
> (I'm figuring that the only members which should not be opDispatch'able are:
> opDispatch itself, the constructors, and the destructor. Anything else, by
> definition, is dispatched on the object.)
I think no. At least, constructor and destructor have some special features
(e.g. can modify const members for construction), but opDispatch doesn't.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list