[Issue 7525] New: Broken return type inference for delegate returns

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 16 14:33:32 PST 2012


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

           Summary: Broken return type inference for delegate returns
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: siegelords_abode at yahoo.com


--- Comment #0 from siegelords_abode at yahoo.com 2012-02-16 14:33:26 PST ---
This worked in DMD 2.057, but doesn't compile in 2.058:

void main()
{
    int a;
    char[] delegate() b = { a = 0; return null;};
}

Error is:

test.d(4): Error: cannot implicitly convert expression (__lambda1) of type
typeof(null) delegate() nothrow @safe to char[] 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