[Issue 12780] Multiplying integer array by scalar double fails

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Dec 26 23:39:44 PST 2014


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

--- Comment #2 from github-bugzilla at puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5bea0130e4d3491dfcae1501f8248b478fb5e8ae
fix Issue 12780 - Multiplying integer array by scalar double fails

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.
  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
  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.
  double_res[] = (int_val ^ int_arr[]) * double_val;
  // typeof(int_val ^ int_arr[]) == int[]

https://github.com/D-Programming-Language/dmd/commit/22611aa7eda98705a5661f0df424434a73b3c837
Merge pull request #4218 from 9rnsr/fix12780

Issue 12780 - Multiplying integer array by scalar double fails

--


More information about the Digitalmars-d-bugs mailing list