[Issue 23262] New: typesafe variadic function parameter cannot infer return
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 21 02:36:02 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23262
Issue ID: 23262
Summary: typesafe variadic function parameter cannot infer
return
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
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`.
--
More information about the Digitalmars-d-bugs
mailing list