D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 23022 - [dip1000] typesafe variadic parameter should not infer return
Summary: [dip1000] typesafe variadic parameter should not infer return
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
: 23244 (view as issue list)
Depends on:
Blocks:
 
Reported: 2022-04-16 13:52 UTC by Dennis
Modified: 2022-07-25 21:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dennis 2022-04-16 13:52:14 UTC
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.
Comment 1 Dennis 2022-07-14 12:04:49 UTC
*** Issue 23244 has been marked as a duplicate of this issue. ***
Comment 2 Dlang Bot 2022-07-25 10:32:51 UTC
@dkorpel created dlang/dmd pull request #14327 "Fix 23022 - typesafe variadic parameter should not infer return" fixing this issue:

- Fix 23022 - typesafe variadic parameter should not infer return

https://github.com/dlang/dmd/pull/14327
Comment 3 Dlang Bot 2022-07-25 21:36:53 UTC
dlang/dmd pull request #14327 "Fix 23022 - typesafe variadic parameter should not infer return" was merged into master:

- 6ad296ecae5a5e9fdd9f118f6151678a683b895a by Dennis Korpel:
  Fix 23022 - typesafe variadic parameter should not infer return

https://github.com/dlang/dmd/pull/14327