Bug 22601 – Slice assignment not working for compatible types

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-12-15T06:05:29Z
Last change time
2024-12-13T19:19:52Z
Assigned to
No Owner
Creator
Răzvan Ștefănescu
Moved to GitHub: dmd#18071 →

Comments

Comment #0 by rumbu — 2021-12-15T06:05:29Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18071 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB