import std.stdio;
template foo(T) {
T foo(T t) {
return t + 1;
}
}
void main() {
writeln(foo(1)); // OK
writeln(foo!(int)(1)); // OK
writeln(foo!(int).foo(1)); // NG
}
bug_d.d(12): Error: expected 1 function arguments, not 0
bug_d.d(12): Error: no property 'foo' for type 'int'
Comment #1 by andrej.mitrovich — 2012-12-09T08:43:20Z
This is a case of the eponymous template. foo!(int) becomes an alias to the inner foo function.