Applies to many forms of op= assignment, including some cases of ref assignment.
Eg.
int foo(int[] x){ auto b = (x~=x)=[1,2,3]; return 3; }
enum bar = foo([7,5]);
Comment #2 by lovelydear — 2012-04-21T11:17:31Z
Actually, the first example gives on 2.059
PS E:\DigitalMars\dmd2\samples> dmd -c bug
bug.d(2): Error: function bug.foo (int x) is not callable using argument types ()
bug.d(2): Error: expected 1 function arguments, not 0
Comment #3 by timon.gehr — 2012-04-21T11:44:38Z
(In reply to comment #2)
> Actually, the first example gives on 2.059
>
> PS E:\DigitalMars\dmd2\samples> dmd -c bug
> bug.d(2): Error: function bug.foo (int x) is not callable using argument types
> ()
> bug.d(2): Error: expected 1 function arguments, not 0
That is a typo. Fixed test case:
int foo(int x){return ++x=1;}
enum bar = foo(0);
Comment #4 by lovelydear — 2012-04-21T14:36:01Z
One could argue that the fact that such code is rejected is rather a good thing.
Comment #5 by timon.gehr — 2012-04-22T09:44:30Z
That is not what this bug report is about. One can never argue that an ICE and spitting out of internal IR are good things.