http://d.puremagic.com/issues/show_bug.cgi?id=8844
Summary: Warning for bug-prone operator overloading Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: diagnostic Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2012-10-17 15:46:15 PDT --- 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. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------