[Issue 13780] Empty ParameterIdentifierTuple for function literal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Aug 29 03:20:18 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=13780

Daniel <wyrlon at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wyrlon at gmx.net
           Hardware|x86_64                      |All
                 OS|Windows                     |All

--- Comment #1 from Daniel <wyrlon at gmx.net> ---
I was just hit by this bug as well.

It's possible to workaround with string parsing, but not pretty.

static if(is(FunctionTypeOf!T P == __parameters))
{
  enum decl = P.stringof[1..$-1]; // hack, strip parenthesis
  // parse decl
}

For a proper fix, __traits(identifier, ...) needs to work for function
literals.

--


More information about the Digitalmars-d-bugs mailing list