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.
Comment #3 by dlang-bot — 2021-12-08T19:36:36Z
@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
Comment #4 by dlang-bot — 2021-12-21T09:14:35Z
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
Comment #5 by dlang-bot — 2022-03-03T11:04:00Z
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
Comment #6 by dlang-bot — 2022-03-08T16:27:11Z
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