I think both the following should compile: int[1] foo1(int[1] a) { a[] += 10; return a; // OK. } int[1] foo2(int[1] a) { return a[] += 10; // Error. } void main() {} DMD 2.066alpha gives: test.d(6,16): Error: cannot implicitly convert expression (_arrayExpSliceAddass_i(a[], 10)) of type int[] to int[1]
*** Issue 12770 has been marked as a duplicate of this issue. ***
(In reply to Kenji Hara from comment #1) > *** Issue 12770 has been marked as a duplicate of this issue. *** I think the good way to solve this bug and others (and to improve D language usability in other ways) is with the enhancement of Issue 13228
(In reply to bearophile_hugs from comment #2) > > I think the good way to solve this bug and others (and to improve D language > usability in other ways) is with the enhancement of Issue 13228 I agree.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18820 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB