[Issue 10502] Can't get fullyQualifiedName of a templated struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 23 00:21:54 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=10502


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |12077


--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2014-02-23 00:21:47 PST ---
To improve fullyQualifiedName, fixing compiler issue 12077 is necessary.

After fixing the compiler bug, adding specialized
fullyQualifiedNameImplForSymbols should fix the issue.

private template fqnTuple(T...)
{
    static if (T.length == 0)
        enum fqnTuple = "";
    else static if (T.length == 1)
        enum fqnTuple = fullyQualifiedName!(T[0]);
    else
        enum fqnTuple = fullyQualifiedName!(T[0]) ~ ", "
                      ~ fqnTuple!(T[1 .. $]);
}

// construct "Base!(Args)" for the instantiated types and symbols
private template fullyQualifiedNameImplForSymbols(alias T : Base!Args, alias
Base, Args...)
{
    enum parentPrefix = fullyQualifiedNameImplForSymbols!(__traits(parent,
Base)) ~ '.';

    enum fullyQualifiedNameImplForSymbols( =
        parentPrefix ~ __traits(identifier, Base) ~ "!(" ~ fqnTuple!Args ~ ")";
}

private template fullyQualifiedNameImplForSymbols(alias T)
{
    ....
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list