www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9831] New: Error message with failed lambda inference

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

           Summary: Error message with failed lambda inference
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-03-29 11:45:40 PDT ---
void main() {
    immutable int c;
    int function(int x) func;
    func = x => c;
}


DMD 2.063alpha gives the error:

temp.d(4): Error: cannot infer function literal type from int function(int x)


But I expect an error similar to other cases of unfit lambdas, similar to:

test.d(4): Error: cannot implicitly convert expression (__lambda1) of type int
delegate(int) nothrow pure  safe to int function(int).

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