Bug 8122 – opDispatch doesn't forward opCall

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-19T20:07:59Z
Last change time
2022-12-01T13:32:04Z
Assigned to
No Owner
Creator
Kenji Hara

Comments

Comment #0 by k.hara.pg — 2012-05-19T20:07:59Z
This issue is separated from issue 8133. (From http://d.puremagic.com/issues/show_bug.cgi?id=8113#c3) struct C { void opDispatch(string op, T...)(T) { } } void main() { C f; f(); } (From http://d.puremagic.com/issues/show_bug.cgi?id=8113#c6) 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", ...) }
Comment #1 by razvan.nitu1305 — 2022-12-01T13:32:04Z
No, I don't think opDispatch should also swallow other overloading operators. Consider that there might be valid operator overloads or functions that are declared but are called wrongfully. If opDispatch swallows everything then it becomes hard to track what happens with other methods. If that is the desired behavior you can simply alias opCall to opDispatch.