Bug 9769 – Remove opEquals from Object

Status
NEW
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-21T00:02:44Z
Last change time
2024-12-07T13:32:25Z
Assigned to
No Owner
Creator
Jonathan M Davis
Depends on
12537
Blocks
1824
Moved to GitHub: dmd#17251 →

Comments

Comment #0 by issues.dlang — 2013-03-21T00:02:44Z
Per this thread http://forum.dlang.org/post/[email protected] , it was decided to try and go the path of removing opEquals, opCmp, toHash, and toString from Object, as they don't need to be there, and the fact that they're there is causing issues with attributes such as const ( issue# 1824 ). This issue is specifically for opEquals so that any work towards making it unnecessary and removing it can be referenced here, whereas the other 3 have separate bugzilla entries, as the work for them isn't necessarily related to each other. opEquals, opCmp, and toHash in particular may require substantial work to be done on the built-in AAs before they can actually be removed from Object, as the AA implementation is not currently templated like it should be.
Comment #1 by issues.dlang — 2013-03-21T00:05:46Z
Related: opCmp: issue# 9770 toHash: issue# 9771 toString: issue# 9772
Comment #2 by doob — 2013-03-21T00:25:12Z
Was there a conclusion on how this will affect backwards compatible?
Comment #3 by issues.dlang — 2013-03-21T00:42:37Z
Comment #4 by issues.dlang — 2013-03-21T00:45:19Z
> Was there a conclusion on how this will affect backwards compatible? No, other than the fact that we'd probably have to keep the functions on opEquals for a while as part of the transition. I expect that the steps will be something like 1. Convert everything over in druntime so that those functions don't have to be on Object. 2. Deprecate the functions on Object. 3. Remove the functions from Object. I expect that it'll take quite a while to go through those stages though, and it may be the case that we'll be forced to remove them from Object faster than we'd like due to some implementation issue that makes it so that keeping it around is a problem; I don't know. Regardless, the first step is making those functions on Object unnecessary, and that's going to take a while (primarily due to AAs).
Comment #5 by issues.dlang — 2013-10-13T16:17:16Z
Relevant discussion on how to transition away from having these functions on Object (the thread got broken up a bit - probably by the mailman bug): http://forum.dlang.org/post/[email protected] http://forum.dlang.org/post/[email protected] The key suggestion is to change the compiler so that those 4 functions can be free functions in object_.d, similar to how the compiler already does special stuff for == rather than simply calling Object's opEquals.
Comment #6 by issues.dlang — 2016-04-15T09:47:53Z
Latest attempt to templatize the free function opEquals (which is not a full fix for this but is the first step in the process): https://github.com/D-Programming-Language/druntime/pull/1439
Comment #7 by robert.schadek — 2024-12-07T13:32:25Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17251 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB