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.