October 15, 2011 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 --- Comment #10 from Kenji Hara <k.hara.pg@gmail.com> 2011-10-15 02:55:26 PDT --- https://github.com/D-Programming-Language/druntime/pull/72 (In reply to comment #8) > 1. what should happen if this is called with a COM object? If two interfaces are identity comparable, returns its result. Otherwise, downcast to Object, and the result is false. And this rule also appleied to C++ interface (COM interface is C++ interface, and the downcasting from C++ interface to Object returns always null). > 2. how does an opEquals defined in an interface interact with the object.opEquals? An interface's opEquals is not used directly. Object.opEquals is always used for the interface comparison when it is possible. > 3. a forced cast, unlike an implicit cast, is a blunt instrument that can do a lot more than simply cast an interface to its base class. If the arguments are other types, what are the conseqences of this forced cast? Same as Steven's comment in #9. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 --- Comment #11 from Walter Bright <bugzilla@digitalmars.com> 2012-02-08 18:42:42 PST --- This is also the root cause of bug 7451. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 dawg@dawgfoto.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dawg@dawgfoto.de --- Comment #12 from dawg@dawgfoto.de 2012-02-08 19:10:45 PST --- It think the proposal in #5459 goes into the right direction. One point of it is to prefer interface opEquals over a downcast. Also, if an interface had an opEquals with a different signature, then Object.opEquals becomes hidden. interface IA { bool opEquals(IA o); } class A { bool opEquals(IA o) { return false; } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |code@klickverbot.at --- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2012-02-08 19:11:04 PST --- *** Issue 7451 has been marked as a duplicate of this issue. *** --- Comment #14 from github-bugzilla@puremagic.com 2012-02-08 19:11:04 PST --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9c8b88ca89afef97a5d3b81ba7bd65cac71fd6d0 fix Issue 4088 - opEquals not called on interfaces -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |code@klickverbot.at --- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2012-02-08 19:11:04 PST --- *** Issue 7451 has been marked as a duplicate of this issue. *** --- Comment #14 from github-bugzilla@puremagic.com 2012-02-08 19:11:04 PST --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9c8b88ca89afef97a5d3b81ba7bd65cac71fd6d0 fix Issue 4088 - opEquals not called on interfaces -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 dawg@dawgfoto.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #15 from dawg@dawgfoto.de 2012-02-08 20:04:35 PST --- Reopened because now implicit interface comparison is fixed, but having opEquals in interfaces still doesn't work. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 --- Comment #16 from Steven Schveighoffer <schveiguy@yahoo.com> 2012-02-08 20:16:23 PST --- Unless the checked-in fix doesn't allow two interfaces to compare, this bug should be closed. It is about the difference between comparing two objects and comparing two interfaces. Prior to this fix, you con't compare two interfaces *period*, even if they defined an identical signature to Object.opEquals. I feel that it should be possible to specialize opEquals for interfaces and objects, but this is a separate problem (and actually an enhancement). IIUC, the applied fix makes it so Objects and interfaces compare in the same way. If I find I can compare two interfaces in the same way I can compare two objects, I'll close this as resolved, and you may open a different bug regarding adding the enhancement of overriding the default behavior of object.opEquals. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |INVALID --- Comment #17 from Walter Bright <bugzilla@digitalmars.com> 2012-02-08 22:36:28 PST --- If there's another issue, please open a new bug report, and please provide an example of the failing code. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 09, 2012 [Issue 4088] opEquals not called on interfaces | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | http://d.puremagic.com/issues/show_bug.cgi?id=4088 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #18 from Steven Schveighoffer <schveiguy@yahoo.com> 2012-02-09 05:36:21 PST --- Restoring resolution, this was fixed after all. -- 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