D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7267 - nothrow functions with lazy arguments too
Summary: nothrow functions with lazy arguments too
Status: RESOLVED DUPLICATE of issue 12647
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-01-10 20:43 UTC by bearophile_hugs
Modified: 2015-02-17 06:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2012-01-10 20:43:27 UTC
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.
Comment 1 Mathias LANG 2015-02-17 06:56:40 UTC
#12647 is a duplicate of this, but has more comments and a P.R. for it, so I'm marking this one as duplicate.

*** This issue has been marked as a duplicate of issue 12 ***
Comment 2 Mathias LANG 2015-02-17 06:57:25 UTC

*** This issue has been marked as a duplicate of issue 12647 ***