Thread overview
[Issue 23420] Deprecate mixing pointer/reference types and value types in the same assignment statement
Oct 16, 2022
mw
Oct 16, 2022
Paul Backus
Dec 17, 2022
Iain Buclaw
October 16, 2022
https://issues.dlang.org/show_bug.cgi?id=23420

--- Comment #1 from mw <mingwu@gmail.com> ---
More comments from the forum discussion

--------
It would be better to error on assigning a new array expression to a static array, there's no reason to allow that. A static array can be assigned a single element arr = 0 instead. Although ideally there would be some syntactical way of making it clear when assigning a slice to a static array, perhaps requiring [] at the end unless it is already a SliceExpression or an array literal.

--
October 16, 2022
https://issues.dlang.org/show_bug.cgi?id=23420

Paul Backus <snarwin+bugzilla@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla@gmail.com
           Severity|normal                      |enhancement

--- Comment #2 from Paul Backus <snarwin+bugzilla@gmail.com> ---
Reduced example:

---
void main()
{
    int[1] sa;
    int[] da = [0];
    sa = da; // equivalent: sa[] = da[]
    da = sa; // equivalent: da = sa[]
}
---

The assignments are allowed because of implicit slicing, so this is a subset of issue 15932.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=23420

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=23420

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/20167

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--