www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22819] New: -preview=in rejects typesafe variadic function


          Issue ID: 22819
           Summary: -preview=in rejects typesafe variadic function
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: stanislav.blinov gmail.com

void foo(in int[3] a...) {}
void bar(scope const int[3] a...) {}
void car(in int[3] x) {}

void main()
    // Both lines compile without -preview=in
    foo(1, 2, 3); // this line fails with -preview=in (cannot pass rvalue
argument `1` of type `int` to parameter `in int[3] a...`)
    bar(1, 2, 3); // but this one compiles in both cases
    car([1, 2, 3]); // so does this

Feb 23 2022