struct A
{
int x;
void opAssign(B b)
{
this.x = b.y;
}
}
struct B { int y; }
A[] bufa;
B[] bufb;
bufa[0] = bufb[0];
//this works calling bufa[0].opAssign(bufb[0])
bufa[] = bufb[];
//cannot implicitly convert expression `bufb[]` of type `B[]` to `A[]`
Since element assignment is possible, it's supposed that slice assignment to be allowed to.
Comment #1 by razvan.nitu1305 — 2022-12-09T12:03:56Z
This is an enhancement request, not a major bug.
Comment #2 by robert.schadek — 2024-12-13T19:19:52Z