[Issue 2372] Template parameter types given as template parameter inhibits template instantiation + missing line number

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Nov 4 07:55:08 PST 2014


https://issues.dlang.org/show_bug.cgi?id=2372

Jonathan Marler <johnnymarler at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johnnymarler at gmail.com

--- Comment #3 from Jonathan Marler <johnnymarler at gmail.com> ---
Can you confirm this code has basically the same issue or should a new bug be
filed for it?
--------------------------------------
import std.stdio;

template Transform(T)
{
  alias Transform = T;
}
void testTransform(T)(Transform!T t)
{
}
void testNoTransform(T)(T t)
{
}
void main(string[] args)
{
  testTransform(3);     // FAILS "cannot deduce function..."
  testTransform!int(3);

  testNoTransform(3);
  testNoTransform!int(3);
}
--------------------------------------

The test(3) line fails with this error message:

main.d(15): Error: template main.testTransform cannot deduce function from
argument types !()(int), candidates are:
main.d(7):        main.testTransform(T)(Transform!T t)

--


More information about the Digitalmars-d-bugs mailing list