[Issue 14346] is-expression dependent on instantiation order

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Apr 25 13:58:28 PDT 2015


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

ag0aep6g at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g at gmail.com

--- Comment #3 from ag0aep6g at gmail.com ---
Reduced further:

----
template typeOf(alias From)
{
    alias typeOf = typeof(From);
}

string val;
int embedded;

void main()
{
    foreach(UDA; Tuple!val)
    {
        pragma(msg, typeOf!UDA); /* prints "string", ok */
    }
    foreach(UDA; Tuple!embedded)
    {
        /* THE RESULT OF THIS DEPENDS ON THE LINE ABOVE: */
        pragma(msg, typeOf!UDA); /* prints "string", should print "int" */
    }
}

alias Tuple(stuff ...) = stuff;
----

This is very similar to issue 14501.

--


More information about the Digitalmars-d-bugs mailing list