[Issue 9830] New: Wrong purity inference for a lambda?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 29 11:44:44 PDT 2013


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

           Summary: Wrong purity inference for a lambda?
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-03-29 11:44:42 PDT ---
I think foo2() too can be pure:


void main() {
    immutable int x;
    int foo1() pure { return x; } // OK
    int delegate() pure foo2 = () => x; // error
}



But DMD 2.063alpha gives:

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

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