Bug 23262 – typesafe variadic function parameter cannot infer return

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-07-21T02:36:02Z
Last change time
2022-07-23T16:39:44Z
Keywords
pull
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2022-07-21T02:36:02Z
struct T() { string[] tags; this(string[] tags...) { this.tags = tags; // typesafe variadic function parameter `tags` of type `string[]` cannot be marked `return` } } void test() { T!() t; } The trouble here is this(), being a template, gets attributes inferred. `return` is inferred for `tags`, which later on fails because such parameters cannot be `return`.
Comment #1 by dlang-bot — 2022-07-21T02:40:28Z
@WalterBright created dlang/dmd pull request #14320 "fix Issue 23262 - typesafe variadic function parameter cannot infer r…" fixing this issue: - fix Issue 23262 - typesafe variadic function parameter cannot infer return https://github.com/dlang/dmd/pull/14320
Comment #2 by dlang-bot — 2022-07-23T16:39:44Z
dlang/dmd pull request #14320 "fix Issue 23262 - typesafe variadic function parameter cannot infer r…" was merged into master: - 29c66cf8c1e1112e678e30acf36d5d1fa687dc79 by Walter Bright: fix Issue 23262 - typesafe variadic function parameter cannot infer return https://github.com/dlang/dmd/pull/14320