Bug 23022 – [dip1000] typesafe variadic parameter should not infer return

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-16T13:52:14Z
Last change time
2022-07-25T21:36:53Z
Keywords
pull
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2022-04-16T13:52:14Z
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 by dkorpel — 2022-07-14T12:04:49Z
*** Issue 23244 has been marked as a duplicate of this issue. ***
Comment #2 by dlang-bot — 2022-07-25T10:32:51Z
@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 by dlang-bot — 2022-07-25T21:36:53Z
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