[Issue 7265] New: Function Literals where a keyword was omitted should be delegate even if inference.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 10 09:30:56 PST 2012


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

           Summary: Function Literals where a keyword was omitted should
                    be delegate even if inference.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: zan77137 at nifty.com


--- Comment #0 from SHOO <zan77137 at nifty.com> 2012-01-10 09:30:54 PST ---
This code should be work (on git head):

-------
import std.stdio;

void main()
{
    auto dg = { writeln("delegate"); };
    static assert(is(typeof(dg) == delegate));
}
-------
main.d(6): Error: static assert  (is(void function() == delegate)) is false
-------

This is being documented as follows:

> If the keywords function or delegate are omitted, it defaults to being a delegate.

-- 
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