www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4320] New: typeof(polymorphic lambda with template alias) is "void"

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4320

           Summary: typeof(polymorphic lambda with template alias) is
                    "void"
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: rayerd.wiz gmail.com


--- Comment #0 from Haruki Shigemori <rayerd.wiz gmail.com> 2010-06-15 06:38:29
PDT ---
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;})();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 15 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4320


Haruki Shigemori <rayerd.wiz gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #1 from Haruki Shigemori <rayerd.wiz gmail.com> 2010-06-16 10:15:43
PDT ---
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...).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 16 2010