D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6328 - Functions using lazy argument cannot be inferred as @safe
Summary: Functions using lazy argument cannot be inferred as @safe
Status: RESOLVED DUPLICATE of issue 6690
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-15 14:08 UTC by kennytm
Modified: 2011-12-21 19:31 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description kennytm 2011-07-15 14:08:31 UTC
Test case:

------------------------------------
int f6328a()(lazy int x) {
    return x;
}
@safe int f6328b()(lazy int x) {   // <-- adding a '@safe' is OK
    return x;
}
@safe int g6328() {
    return f6328a(1+1);   // <-- but it won't be inferred as '@safe'
}
------------------------------------
x.d(8): Error: safe function 'g6328' cannot call system function 'f6328a'
------------------------------------

I'm marking it as 'enhancement' because I don't know if this is intentional to avoid the lazy argument from calling unsafe code.
Comment 1 Kenji Hara 2011-12-21 19:31:25 UTC

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