[Issue 6942] New: lazy parameters can break purity

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 13 04:49:30 PST 2011


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

           Summary: lazy parameters can break purity
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2011-11-13 04:48:46 PST ---
int foo(lazy int x) pure{
    return x()+x();
}

void main(){
    auto a=foo((writeln("impure"),1));
}

This compiles and prints
impure
impure

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