[Issue 7585] New: functions in templates inferred as delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 25 09:22:36 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7585

           Summary: functions in templates inferred as delegate
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simendsjo at gmail.com


--- Comment #0 from simendsjo <simendsjo at gmail.com> 2012-02-25 09:22:34 PST ---
extern(C) alias void function() Callback;

template Wrap(alias dg)
{
    extern(C) void Wrap()
    {
        dg();
    }
}

void main()
{
    Callback cb = &Wrap!( () {} );
}

Error: cannot implicitly convert expression (&Wrap) of type void delegate()
pure nothrow @safe to extern (C) void function()

According to Timon Gehr: "'() {}' should be inferred as void function()pure
nothrow @safe." http://forum.dlang.org/post/jib1a2$1jl5$1@digitalmars.com

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


More information about the Digitalmars-d-bugs mailing list