<div dir="ltr"><div>Does anyone understand why this doesn't work?</div><div><br></div><div>void f(T)(const(T)[] x, const(T)* y) {}<br>void test()<br>{<br> int*[] x;<br> const int* y;<br> f(x, &y);<br>}</div><div><br></div><div>error : template `f` is not callable using argument types `!()(int*[], const(int*)*)`<br> Candidate is: `f(T)(const(T)[] x, const(T)* y)`</div><div><br></div><div>
Should this work? It looks like it should work to me.</div><div>...assuming T is inferred to be `int*`... which it's not clear why it wouldn't be?</div><div><br></div><div>The argument `y` is an exact match. The argument `x` requires a const promotion, and then T can be inferred correctly. Perhaps it's the order of that operation that it can't deal with?</div><div><br></div><div>I kinda reckon this is a bug...<br></div></div>