Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty ParameterIdentifierTuple for function literal #18918

Open
dlangBugzillaToGithub opened this issue Nov 26, 2014 · 2 comments
Open

Empty ParameterIdentifierTuple for function literal #18918

dlangBugzillaToGithub opened this issue Nov 26, 2014 · 2 comments

Comments

@dlangBugzillaToGithub
Copy link

Meta reported this on 2014-11-26T21:09:58Z

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

CC List

Description

import std.stdio;
import std.traits;

void main()
{
    //Prints a blank line
    writeln(ParameterIdentifierTuple!((int n) => n));
}
@dlangBugzillaToGithub
Copy link
Author

wyrlon commented on 2015-08-29T10:20:18Z

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.

@dlangBugzillaToGithub
Copy link
Author

luis commented on 2015-09-01T09:15:04Z

Pull request:
https://github.com/D-Programming-Language/phobos/pull/3620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant