www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23022] New: [dip1000] typesafe variadic parameter should not


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

Reduced from a unittest in std.path, uncovered by

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.

Apr 16 2022