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

--- Comment #2 from [email protected] ---
Found this (partial) workaround:

------
class C { /* ... */ }
struct S
{
    C c;
    auto opDispatch(string field)() inout
    {
        return mixin("c."~field);
    }
}
------

The key here is the `inout`.

This works as long as you don't expect to implicitly convert S to C. You can
access class fields as if they were fields in S.

For implicit conversion, though, I haven't come up with a good workaround yet.

--

Reply via email to