int[5] foo(int[2] a, int[3] b) { typeof(return) result = a ~ b; // OK return result; } int[5] bar(int[2] a, int[3] b) { return a ~ b; // Error } void main() {} DMD 2.066alpha gives: test2.d(6,12): Error: cannot implicitly convert expression (cast(int[])a ~ cast(int[])b) of type int[] to int[5] I suggest to support the code in bar() too. (A small optimization can even remove any heap allocations from the bar() function). I am not sure, but perhaps the solution is similar to a value range propagation: to propagate the statically known length of an array. (Expecially for immutable arrays, as in Issue 10594 ).
Issue 1654 covers this in great details, so marking as duplicate. *** This issue has been marked as a duplicate of issue 1654 ***