[Issue 21073] Rebindable does not work when class has alias this to inout property

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 9 19:06:53 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21073

Ajieskola at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Ajieskola at gmail.com
          Component|phobos                      |dmd

--- Comment #1 from Ajieskola at gmail.com ---
This is indeed a regression, but a compiler one, not a standard library one.
Test case for the ultimate cause:

```d
class C
{
    auto internal() const
    {
        return 5;
    }
    alias internal this;
};

void main() pure
{
    const c = new C;
    auto r = cast(C)c;
}
```

This should compile (I think?), but does not (since 2.084). Using `cast()`
instead of `cast(C)` still works.

--


More information about the Digitalmars-d-bugs mailing list