[Issue 22819] New: -preview=in rejects typesafe variadic function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 23 11:16:38 UTC 2022


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

          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 at puremagic.com
          Reporter: stanislav.blinov at 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
}

--


More information about the Digitalmars-d-bugs mailing list