cat > bug.d << CODE
void foo(T)(auto ref T t)
{
}
void bar()
{
int v = 12;
foo!long(v);
}
CODE
----
dmd -c bug
----
bug.d(8): Error: template bug.foo cannot deduce function from argument types !(long)(int), candidates are:
bug.d(1): bug.foo(T)(auto ref T t)
----
The compiler seems to reject this because it tries to bind the lvalue argument via reference. IMO implicit conversion of arguments types should be run before determining lvalueness to resolve this.
Comment #1 by robert.schadek — 2024-12-13T18:22:13Z