[Issue 6332] New: Auto-return function cannot be inferred as @safe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 16 01:37:56 PDT 2011


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

           Summary: Auto-return function cannot be inferred as @safe
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2011-07-16 01:32:42 PDT ---
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'
----------------------------------

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


More information about the Digitalmars-d-bugs mailing list