This is correct D2 code, and it gives no error messages: void foo(T)(const ref T[] a) {} void bar(in int[] b) { foo(b); } void main() {} This is wrong D2 code (I have replaced "const ref" with "ref"): void foo(T)(ref T[] a) {} void bar(in int[] b) { foo(b); } void main() {} DMD 2.059 gives this error message: temp.d(1): Error: template temp.foo(T) cannot deduce template function from argument types !()(const(int[])) In this case I'd like a better error message.
Error message now looks like: test.d(3,8): Error: template test.foo cannot deduce function from argument types !()(const(int[])), candidates are: test.d(1,6): test.foo(T)(ref T[] a) Hopefully that qualifies as an improvement!