www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8968] New: std.traits.ParameterIdentifierTuple is undocumented and doesn't work with ref params

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8968

           Summary: std.traits.ParameterIdentifierTuple is undocumented
                    and doesn't work with ref params
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



10:18:54 PST ---
import std.traits;

void foo(ref int x) { }

void main()
{
    alias ParameterIdentifierTuple!foo x;
}

D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\traits.d(518): Error: function
literal __lambda16 (ref int x) is not callable using argument types (int)

It tries to use a clever trick by defining an inner lambda with a parameter
list, and then extracts the name from that. But it can't call a lambda with a
ref parameter at compile-time. 

Honestly we should just have a simple __trait that returns the parameter
identifiers, because this is a very hacky workaround that doesn't work in all
cases.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 06 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8968


Ellery Newcomer <ellery-newcomer utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ellery-newcomer utulsa.edu



17:38:58 PST ---
its documented now

https://github.com/D-Programming-Language/phobos/pull/946

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 14 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8968


Ellery Newcomer <ellery-newcomer utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



17:57:25 PST ---
and evidently does work with ref int now:

https://github.com/D-Programming-Language/phobos/commit/49cbab43c2bdf5d14d51d869c62e010befa3bcab

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