The following code used to work fine up to dmd 2.062.
Error message of dmd 2.063.2 and dmd 2.064 beta 1:
repro.d(16): Error: template repro.SmartPtr!(Object).SmartPtr.opAssign(U)(auto ref U rh) cannot deduce template function
from argument types !()(SmartPtr!(Object))
Error message of dmd 2.064 git head:
repro.d(16): Error: template repro.SmartPtr!(Object).SmartPtr.opAssign does not match any function template declaration.
Candidates are:
repro.d(8): repro.SmartPtr!(Object).SmartPtr.opAssign(U)(auto ref U rh)
repro.d(16): Error: template repro.SmartPtr!(Object).SmartPtr.opAssign(U)(auto ref U rh) cannot deduce template function
from argument types !()(SmartPtr!(Object))
Repro case:
struct SmartPtr(T)
{
~this()
{
}
// BUG: adding "auto ref" to U will fail compilation
void opAssign(U)(auto ref U rh)
{
}
}
void main(string[] args)
{
SmartPtr!Object a;
a = SmartPtr!Object();
}