Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 02, 2008 [Issue 2327] New: opDot() should work as expected with operator overloading. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2327 Summary: opDot() should work as expected with operator overloading. Product: D Version: 2.018 Platform: PC OS/Version: Windows Status: NEW Severity: minor Priority: P3 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: dsimcha@yahoo.com struct Foo { uint i; Foo opAdd(uint input) { return Foo(i + input); } } struct Bar { Foo foo; Foo opDot() { return foo; } } void main() { Bar bar; auto result = bar.opAdd(5); //Works. auto result2 = bar + 5; //Compile time error: test.d|22|Error: incompatible types for ((bar) + (5)): 'Bar' and 'int'| } IMHO, this behavior is incorrect. Operator overloading is supposed to be semantically equivalent to calling the method with the overload name, i.e. a + b is supposed to be the exact semantic equivalent of a.opAdd(b) if a and b are class or struct objects with overloaded opAdd. In this case, it clearly isn't. -- |
August 16, 2010 [Issue 2327] opDot() should work as expected with operator overloading. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2327 --- Comment #1 from David Simcha <dsimcha@yahoo.com> 2010-08-15 21:28:28 PDT --- Is opDot() going to be deprecated once alias this is better-debugged? I see no reason why it shouldn't be. If so, I'll mark this as wontfix. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 27, 2011 [Issue 2327] opDot() should work as expected with operator overloading. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2327 David Simcha <dsimcha@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX --- Comment #2 from David Simcha <dsimcha@yahoo.com> 2011-08-27 07:37:14 PDT --- I'm resolving this as WONTFIX because opDot has been superseded by alias this and is no longer documented and scheduled for deprecation. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 14, 2012 [Issue 2327] opDot() should work as expected with operator overloading. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2327 Trass3r <mrmocool@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mrmocool@gmx.de --- Comment #3 from Trass3r <mrmocool@gmx.de> 2012-05-14 13:42:51 CEST --- When will it be deprecated? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation