import std.stdio; void func(alias fn)() { writeln(typeid(typeof(fn)));// void, NG!!! } void main() { int delegate(int) g; writeln(typeid(typeof(g)));// int delegate(), OK! writeln(typeid(typeof((int){return 1;})));// int delegate(), OK! func!((i){return 1;})(); }
Sorry! I want to back down on this issue. "(i){return 1;}" is a function template (not delegate literal). typeof(function template) has not a type (However I do not think this is a type void. uhmm...).