www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5752] New: Incorrect memoisation during function parameter name introspection

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: johnaston.dev gmail.com



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: -------
Mar 19 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5752


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 3358 ***

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