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: [email protected]
          Reporter: [email protected]

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`.

--

Reply via email to