Bug 4320 – typeof(polymorphic lambda with template alias) is "void"
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-06-15T06:38:00Z
Last change time
2010-06-16T10:15:43Z
Assigned to
nobody
Creator
rayerd.wiz
Comments
Comment #0 by rayerd.wiz — 2010-06-15T06:38:29Z
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;})();
}
Comment #1 by rayerd.wiz — 2010-06-16T10:15:43Z
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...).