[Issue 2753] New: Cannot declare pointer to function returning ref

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 21 14:21:19 PDT 2009


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

           Summary: Cannot declare pointer to function returning ref
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jlquinn at optonline.net


ref int c() { static int a=2; return a; }
ref int function() d = &c; // line 8

foo.d(8): variable foo.d only parameters or foreach declarations can be ref

Type inference, however, is able to figure it out:

ref int c() { static int a=2; return a; }
auto d = &c; // whee

Correctly reporting the issue from bug 2735


-- 



More information about the Digitalmars-d-bugs mailing list