Bug 13780 – Empty ParameterIdentifierTuple for function literal

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-26T21:09:58Z
Last change time
2024-12-13T18:36:40Z
Keywords
pull
Assigned to
No Owner
Creator
Meta
Moved to GitHub: dmd#18918 →

Comments

Comment #0 by monkeyworks12 — 2014-11-26T21:09:58Z
import std.stdio; import std.traits; void main() { //Prints a blank line writeln(ParameterIdentifierTuple!((int n) => n)); }
Comment #1 by wyrlon — 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.
Comment #2 by luis — 2015-09-01T09:15:04Z
Comment #3 by robert.schadek — 2024-12-13T18:36:40Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18918 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB