[Issue 23022] New: [dip1000] typesafe variadic parameter should not infer return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 16 13:52:14 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23022

          Issue ID: 23022
           Summary: [dip1000] typesafe variadic parameter should not infer
                    return
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

Reduced from a unittest in std.path, uncovered by
https://github.com/dlang/dmd/pull/13993

```
auto ir(string[] p...)
{
    return p;
}
```

As of https://github.com/dlang/dmd/pull/13710, typesafe variadic args may not
be `return scope` anymore. However, when the compiler infers `return scope`,
the errors is confusing:

Error: typesafe variadic function parameter `p` of type `string[]` cannot be
marked `return`

The compiler should not infer `return scope` in the first place.

--


More information about the Digitalmars-d-bugs mailing list