struct Foo { Foo opBinary(string op="-")(Foo f) { return Foo(); } } void main() { auto Foo = Foo() + Foo(); } Compiles and run with no errors, dmd 2.061alpha, because "-" is a default argument for the op template argument, so that code is formally correct. But I'd like a warning here (or an error?), because I think such code is bug-prone.
Technically it's still callable: auto Foo = Foo().opBinary(Foo()); But I don't know why someone would explicitly call opBinary without operators. Making it an error could help catch bugs though. +1 from me.
This is part of a more general problem that is default template parameter values are not always checked. *** This issue has been marked as a duplicate of issue 20576 ***