Thread overview
[Issue 18615] Rebindable!A doesn't use class A's opEquals (returns a is b instead)
Mar 15, 2018
greenify
Mar 28, 2018
Simon Na.
Mar 28, 2018
Simon Na.
Mar 28, 2018
Seb
Mar 29, 2018
Simon Na.
Mar 29, 2018
Simon Naarmann
March 15, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

greenify <greeenify@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greeenify@gmail.com

--- Comment #1 from greenify <greeenify@gmail.com> ---
Imho this is a bug. I can't even think about a good use case where the current behavior would be preferred.

--
March 28, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

Simon Na. <eiderdaus@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|nobody@puremagic.com        |eiderdaus@gmail.com

--
March 28, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

Simon Na. <eiderdaus@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Simon Na. <eiderdaus@gmail.com> ---
Thanks, I'll take a crack at this then because nobody considers it a feature. The fix looks obvious to me and I've always wanted to contribute to D.

--
March 28, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com

--- Comment #3 from Seb <greensunny12@gmail.com> ---
BTW Nullable seems to have had a similar flaw, might be worthwhile to look at briefly:

https://github.com/dlang/phobos/pull/5032


> Thanks, I'll take a crack at this then because nobody considers it a feature. The fix looks obvious to me and I've always wanted to contribute to D.

Cool! Please let us know if you hit any road bumps etc. ;-)

--
March 29, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

--- Comment #4 from Simon Na. <eiderdaus@gmail.com> ---
I've got a PR for Phobos ready at: https://github.com/dlang/phobos/pull/6370

The root cause was that union equality is always bitwise. The compiler issue is
15828, and the consensus seems that implicit union comparison should be a
compiler error:
https://issues.dlang.org/show_bug.cgi?id=15828

My PR for 18615 works independently of 15828 because I compare the class reference inside the union explicitly with == against rhs's class reference.

> Cool! Please let us know if you hit any road bumps etc. ;-)

Thanks, it's been smooth sailing so far!

-- Simon

--
March 29, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

Simon Naarmann <eiderdaus@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--
April 05, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/65b1f1af77b099ab97c94d802f027fa89cef0165 Fix Issue 18615 - Rebindable!A calls A.opEquals

The issue was that Rebindable!A always compared two rebindable references by 'a is b', not by A.opEquals. With this fix, two rebindable references, or a rebindable and a raw reference, always compare with A.opEquals.

https://github.com/dlang/phobos/commit/9de28234bff85df508890f3b202515b63e590319 Merge pull request #6370 from SimonN/issue18615

Fix Issue 18615 - Rebindable!A calls A.opEquals merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>

--
April 05, 2018
https://issues.dlang.org/show_bug.cgi?id=18615

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--