Thread overview | |||||
---|---|---|---|---|---|
|
April 18, 2011 [Issue 5856] New: overloading on const doesn't work for operator overload | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5856 Summary: overloading on const doesn't work for operator overload Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: k.hara.pg@gmail.com --- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2011-04-18 13:42:03 PDT --- import std.stdio; struct X { void f() { writeln("X.f mutable"); } void f() const { writeln("X.f const"); } void g()() { writeln("X.g mutable"); } void g()() const { writeln("X.g const"); } void opOpAssign(string op)(int n) { writeln("X+= mutable"); } void opOpAssign(string op)(int n) const { writeln("X+= const"); } } void main() { X xm; xm.f(); // prints "X.f mutable" xm.g(); // prints "X.g mutable" xm += 10; // should print "X+= mutable" (1) const(X) xc; xc.f(); // prints "X.f const" xc.g(); // prints "X.g const" xc += 10; // should print "X+= const" (2) } Compiling this code occurs ambiguous error on line (1) and (2). I think issue 3810 is related. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 26, 2011 [Issue 5856] overloading on const doesn't work for operator overload | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kenji Hara | http://d.puremagic.com/issues/show_bug.cgi?id=5856 --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-04-26 06:18:56 PDT --- Created an attachment (id=949) testcase patch pull requested: https://github.com/D-Programming-Language/dmd/pull/42 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 18, 2011 [Issue 5856] overloading on const doesn't work for operator overload | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kenji Hara | http://d.puremagic.com/issues/show_bug.cgi?id=5856 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-06-17 22:38:48 PDT --- https://github.com/D-Programming-Language/dmd/commit/541c495d1f208f89ee9031cce796fe9598146cbc -- 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