[Issue 6269] aliasing in IsExpression doesn't work when used inside a template constraint

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 22 11:30:36 UTC 2022


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #5 from Nick Treleaven <nick at geany.org> ---
I thought fixing this might break the `static if` workaround, but it seems fine
at least with a template specialization:

//struct S(T)
    //if (is(T : U*, U))
struct S(T : U*, U)
{
    static if (is(T : U*, U)){} // no error though U exists
    pragma(msg, U);
}

alias A = S!(int*);

I think because U already exists, the `is` in the `static if` does not try to
introduce another U.

--


More information about the Digitalmars-d-bugs mailing list