On Saturday, 29 November 2014 at 18:19:40 UTC, Sly wrote:
You miss another definition which introduces a conflict: T getResponse(T)(string question) {...}
In that case, you're better off with a pair of declarations: struct Point(T) { T x; T y; } T getResponse(T)(string message) if (!is(T == Point!U, U)) { return T.init; } Point!T getResponse(T)(string message) if (is(T == Point!U, U)) { return Point!T(T.init, T.init); } void main() { auto t = getResponse!int("test"); auto p = getResponse!(Point!int)("test"); }