[Issue 13009] [REG2.064] inout overload conflicts with non-inout when used via alias this

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 30 08:35:08 PDT 2015


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

Vladimir Panteleev <thecybershadow at gmail.com> changed:

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

--- Comment #16 from Vladimir Panteleev <thecybershadow at gmail.com> ---
(In reply to Kenji Hara from comment #9)
> https://github.com/D-Programming-Language/dmd/pull/4417

Sorry, but that fix is incomplete and doesn't actually fix the real-life
problem (comment #3).

Updated reduced test case:

///////// test.d ////////
struct T
{
    void put(char c) {}
}

struct S
{
    T t;

    static if (true)
    {
        T getT()
        {
            return t;
        }
    }

    inout(T) getT() inout
    {
        return t;
    }

    alias getT this;
}

alias Sput = S.put;
/////////////////////////

Note the "static if (true)". Without it compilation works.

--


More information about the Digitalmars-d-bugs mailing list