Comment #0 by bearophile_hugs — 2014-04-25T14:10:21Z
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]
Comment #1 by k.hara.pg — 2014-09-21T03:52:51Z
*** Issue 12770 has been marked as a duplicate of this issue. ***
Comment #2 by bearophile_hugs — 2014-09-21T09:41:09Z
(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
Comment #3 by yebblies — 2014-11-04T08:26:33Z
(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.
Comment #4 by robert.schadek — 2024-12-13T18:20:06Z