Thread overview
[Issue 22136] [REG 2.097.1] hashOf failed to compile because of different inheritance order
Sep 16, 2021
Paul Backus
Sep 17, 2021
Tejas_Garhewal
Dec 08, 2021
Eduard Staniloiu
Dec 08, 2021
Eduard Staniloiu
Dec 08, 2021
Dlang Bot
Dec 21, 2021
Dlang Bot
Mar 03, 2022
Dlang Bot
Mar 08, 2022
Dlang Bot
September 16, 2021
https://issues.dlang.org/show_bug.cgi?id=22136

Paul Backus <snarwin+bugzilla@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla@gmail.com
            Summary|hashOf failed to compile    |[REG 2.097.1] hashOf failed
                   |because of different        |to compile because of
                   |inheritance order in DMD    |different inheritance order
                   |2.097.1                     |
           Severity|critical                    |regression

--
September 17, 2021
https://issues.dlang.org/show_bug.cgi?id=22136

Tejas_Garhewal <scienticman@gmail.com> changed:

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

--- Comment #1 from Tejas_Garhewal <scienticman@gmail.com> ---
Seems to be a regression.

Works fine on dmd 2.097.0
(https://run.dlang.io/gist/cb1ed3bd5db4cf5b99e26454116b969a?args=-h)

Works fine on ldc2 1.25.0 (based on 2.095.1)

--
December 08, 2021
https://issues.dlang.org/show_bug.cgi?id=22136

Eduard Staniloiu <edi33416@gmail.com> changed:

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

--
December 08, 2021
https://issues.dlang.org/show_bug.cgi?id=22136

--- Comment #2 from Eduard Staniloiu <edi33416@gmail.com> ---
I did some digging on this, and the bug actually stems from the following issue

```
interface IObject
{
   size_t toHash() @trusted nothrow;
}

interface Dummy {}
interface Bug(E) : Dummy, IObject {}



                                   interface OK(E) : IObject, Dummy {}

static assert(is(immutable OK!string* : immutable IObject*))); // OK
static assert(is(immutable Bug!string* : immutable IObject*))); // fails
```

It appears that the order affects the is expression and
the `is(immutable T* : immutable U*)` check is done inside the `hashOf`
function.

I'm currently investigating this in dmd.

--
December 08, 2021
https://issues.dlang.org/show_bug.cgi?id=22136

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@edi33416 created dlang/dmd pull request #13404 "Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of d…" fixing this issue:

- Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of different inheritance order

https://github.com/dlang/dmd/pull/13404

--
December 21, 2021
https://issues.dlang.org/show_bug.cgi?id=22136

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13404 "Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of d…" was merged into stable:

- 289394fab4695d3f601767ea004f9c1737880395 by Eduard Staniloiu:
  Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of different
inheritance order

https://github.com/dlang/dmd/pull/13404

--
March 03, 2022
https://issues.dlang.org/show_bug.cgi?id=22136

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13745 "Revert "Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of d…"" was merged into stable:

- 646fe4e97e1dae3e083ae461931f123f036bd4cf by Nathan Sashihara:
  Revert "Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of
different inheritance order (#13404)"

  This reverts commit 646ec178ffa13cf596026dae4217fdad27ad777c.

https://github.com/dlang/dmd/pull/13745

--
March 08, 2022
https://issues.dlang.org/show_bug.cgi?id=22136

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13785 "merge stable" was merged into master:

- da491b8ada5f557a222c369f7f1bb481ca10880e by Nathan Sashihara:
  Revert "Fix Issue 22136 - [REG 2.097.1] hashOf failed to compile because of
different inheritance order (#13404)" (#13745)

  This reverts commit 646ec178ffa13cf596026dae4217fdad27ad777c.

https://github.com/dlang/dmd/pull/13785

--