D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4320 - typeof(polymorphic lambda with template alias) is "void"
Summary: typeof(polymorphic lambda with template alias) is "void"
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 06:38 UTC by Haruki Shigemori
Modified: 2010-06-16 10:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Haruki Shigemori 2010-06-15 06:38:29 UTC
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 Haruki Shigemori 2010-06-16 10:15:43 UTC
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...).