Hi,

could you check whether it is correct, that second line in main
failes with a compiler error?
I think the compiler should be able to deduce the type without
explicitly passing it to the method call.

Kind regards
André

template ClassTemplate()
{
  static auto deserialize(this MyType)()
  {
    return new MyType();
  }
}

class A
{
  mixin ClassTemplate;
}

void main()
{
  A a = A.deserialize!A(); // Working
  A b = A.deserialize(); // Not working
}

source\app.d(17): Error: template app.A.ClassTemplate!().deserialize cannot dedu
ce function from argument types !()(), candidates are:
source\app.d(3): app.A.ClassTemplate!().deserialize(this MyType)()

Reply via email to