void f(T)(const(T)[] x, const(T)* y) {}
void test()
{
// this works; T is inferred as int
int[] x;
const int y;
f(x, &y);
// fails: expected that T is inferred as int*
int*[] a;
const int* b;
f(a, &b);
}
Something about a/b being an arrangement of int* compared to x/y with int causes this to fail.
I reckon the non-uniformity of this type deduction logic is a bug.
This non-uniformity has caused me several problems with meta code.
I think it's banging into an issue with const promotion; if you remove const from y and b, both cases work properly.
Comment #1 by robert.schadek — 2024-12-13T19:37:42Z