www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7267] New: nothrow functions with lazy arguments too

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

           Summary: nothrow functions with lazy arguments too
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



int foo(lazy int bar) nothrow {
    return bar();
}
void main() {
    int r = foo(10);
}



DMD 2.058 head:

test.d(2): Error: bar is not nothrow
test.d(1): Error: function test4.foo 'foo' is nothrow yet may throw


But I think foo() is allowed to be nothrow.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 10 2012