http://d.puremagic.com/issues/show_bug.cgi?id=5752

           Summary: Incorrect memoisation during function parameter name
                    introspection
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: johnaston....@gmail.com


--- Comment #0 from John Aston <johnaston....@gmail.com> 2011-03-19 04:04:52 
PDT ---
import std.stdio;

int funcOne(int paramOne)
{
    return paramOne + 1;
}

int funcOther(int paramOther)
{
    return paramOther + 1;
}

void printFunc(alias f)()
{
    writeln(__traits(identifier,f)," : ",(typeof(&f)).stringof);
}

void main()
{
    printFunc!funcOne();
    printFunc!funcOther();
}

The above code returns on dmd.2.052:
funcOne : int function(int paramOne)
funcOther : int function(int paramOne)

Since the stringof property goes via the type rather than the alias, two
functions with different parameter names but the same type signature will be
confused.  The extraction of the parameter names I find very useful for
automatic function reflection.

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

Reply via email to