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' ----------------------------------
Comment #1 by k.hara.pg — 2011-12-21T07:58:29Z
Comment #2 by kennytm — 2012-02-07T13:01:45Z
Comment #3 by lovelydear — 2012-04-20T15:42:30Z
Compiles with 2.059 on Win32.
Comment #4 by github-bugzilla — 2012-11-08T01:23:17Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a8cae622dfa93d98b6a10aa4f869713675c5aff5 fix Issue 6332 - Auto-return function cannot be inferred as @safe https://github.com/D-Programming-Language/dmd/commit/f6a212814630113441a567777a307a197400b922 Merge pull request #544 from 9rnsr/fix6963 Issue 6332 & 6356 & 6963 - Ignite pure/nothrow inference for template function