Bug 6332 – Auto-return function cannot be inferred as @safe
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-16T01:32:00Z
Last change time
2013-02-05T13:21:03Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
kennytm
Comments
Comment #0 by kennytm — 2011-07-16T01:32:42Z
Test case:
----------------------------------
auto f6332a()() { return 1; }
int f6332b()() { return 1; }
@safe int g6332() {
auto x = f6332b(); // OK when returning 'int'
x = f6332a(); // error when returning 'auto'
return x;
}
----------------------------------
x.d(5): Error: safe function 'g6332' cannot call system function 'f6332a'
----------------------------------