[Issue 23599] New: tuples not expanded in struct initializer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 4 10:19:01 UTC 2023


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

          Issue ID: 23599
           Summary: tuples not expanded in struct initializer
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

Found while implementing named arguments:
https://github.com/dlang/dmd/pull/14776#issuecomment-1369269255

```
struct S { int x, y; }
alias Seq(T...) = T;
void f()
{
    S s0 = S( Seq!(1, 2) );  // < works
    S s1 =  { Seq!(1, 2) }; // < error
}
```

> Error: cannot implicitly convert expression `tuple(1, 2)` of type `(int, int)` to `int`

--


More information about the Digitalmars-d-bugs mailing list