Bug 10795 – Bad return type of ParameterIdentifierTuple if there is no arguments

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-11T11:08:00Z
Last change time
2013-08-30T12:33:56Z
Assigned to
nobody
Creator
temtaime

Comments

Comment #0 by temtaime — 2013-08-11T11:08:27Z
import std.stdio; import std.traits; void foo() { } void main() { enum arr = [ ParameterIdentifierTuple!foo ]; writeln(typeof(arr).stringof); } Prints: void[]
Comment #1 by yebblies — 2013-08-29T05:37:38Z
What would you expect it to be? It expands to: import std.stdio; import std.traits; void foo() { } void main() { enum arr = [ ]; writeln(typeof(arr).stringof); } And arr is correctly inferred to have a type of void[] (the type of the literal []). There are no expressions the the result of ParameterIdentifierTuple to infer any other type from.
Comment #2 by temtaime — 2013-08-30T12:33:56Z
Sorry, seems to be my mistake.