digitalmars.D.bugs - [Issue 3607] New: Problems with struct opEquals and const
- d-bugmail puremagic.com (40/40) Dec 11 2009 http://d.puremagic.com/issues/show_bug.cgi?id=3607
- d-bugmail puremagic.com (12/12) Sep 22 2010 http://d.puremagic.com/issues/show_bug.cgi?id=3607
- d-bugmail puremagic.com (10/10) Sep 22 2010 http://d.puremagic.com/issues/show_bug.cgi?id=3607
- d-bugmail puremagic.com (22/25) Dec 01 2010 http://d.puremagic.com/issues/show_bug.cgi?id=3607
- d-bugmail puremagic.com (6/6) Dec 01 2010 http://d.puremagic.com/issues/show_bug.cgi?id=3607
- d-bugmail puremagic.com (12/12) Jun 12 2011 http://d.puremagic.com/issues/show_bug.cgi?id=3607
http://d.puremagic.com/issues/show_bug.cgi?id=3607 Summary: Problems with struct opEquals and const Product: D Version: 2.036 Platform: x86 URL: http://www.digitalmars.com/webnews/newsgroups.php?art_ group=digitalmars.D.learn&article_id=18407 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: webby beardmouse.org.uk PST --- While trying to build the Juno library with DMD 2.037, i got a bunch or errors like: juno\com\core.d(295): Error: function juno.com.core.GUID.opEquals type signature should be const bool(ref const(GUID)) not bool(GUID other) Which can be replicated with: //////////////////////////////// struct Foo { bool opEquals(Foo f) const { return true; } } void Bar() { Foo f; } //////////////////////////////// As mentioned in the post http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=18407, the error seems to have been caused by changeset 260, which was made to fix bug 3433. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 11 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3607 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au Summary|Problems with struct |Regression(2.037) Problems |opEquals and const |with struct opEquals and | |const Severity|normal |regression -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 22 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3607 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs eml.cc *** Issue 4289 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 22 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3607 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Regression(2.037) Problems |Problems with struct |with struct opEquals and |opEquals and const |const | Severity|regression |enhancement The error message is correct, and the code compiles if you change the signature to ref const Foo. The spec clearly states: "If structs declare an opEquals member function, it should follow the following form: struct S { int opEquals(ref const S s) { ... } }" A key point in the forum discussion, which was missing from the bug report was this comment:I think it should be allowed to have a signature like this: bool opEquals(T other) const inside T as long as T can be implicitly cast from const to mutable.Changing to an enhancement request. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 01 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3607 PST --- Shouldn't the spec say 'bool opEquals' instead of 'int opEquals' ? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 01 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3607 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies gmail.com Resolution| |DUPLICATE *** This issue has been marked as a duplicate of issue 3659 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 12 2011