[Issue 23264] New: Allow __traits(parameters) in the return type or contract of a function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 21 13:36:04 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23264
Issue ID: 23264
Summary: Allow __traits(parameters) in the return type or
contract of a function
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: qs.il.paperinik at gmail.com
Allow __traits(parameters) to occur in any part of the function, not only its
body and `in` and `out` contract.
The following should be legal:
typeof(__traits(parameters))[0] f(Ts...)(Ts args) { … }
void f(Ts...)(Ts args)
if (__traits(parameters).length > 1)
{ … }
But they are rejected with
Error: `__traits(parameters)` may only be used inside a function
It is unmistakably clear what the intention is.
--
More information about the Digitalmars-d-bugs
mailing list