Bug 8968 – std.traits.ParameterIdentifierTuple is undocumented and doesn't work with ref params
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-06T10:18:00Z
Last change time
2012-11-14T17:57:25Z
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2012-11-06T10:18:54Z
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.
Comment #1 by ellery-newcomer — 2012-11-14T17:38:58Z