D-Programming-Language/dmd — pull request #4218 by 9rnsr (2014-12-19 14:52:02+00:00)
Title: Issue 12780 - Multiplying integer array by scalar double fails

https://issues.dlang.org/show_bug.cgi?id=12780

Support upcasting slice elements in array operations.

1. The tweak in the buildArrayIdent() retains backward compatibility.

a) If no element upcasting exists in array operation, the generated function name is not changed.
```d
double_res[] = double_val * double_arr[];
// _arrayExpSliceMulSliceAssign_d
```
b) If upcasting slice elements is necessary, it will be encoded by the postfix "Of" + element-type-deco
```d
double_res[] = double_val * int_arr[];
// _arrayExpSlice'Ofi'MulSliceAssign_d
```

2. Even if the whole array operation requires double element, the sub array operations can be processed by int.
```d
double_res[] = (int_val ^ int_arr[]) * double_val;
// typeof(int_val ^ int_arr[]) == int[]
```