Thread overview
[Issue 5828] New: Cannot declare a variable of type "X function() ref" without auto
Apr 10, 2011
timon.gehr@gmx.ch
[Issue 5828] Cannot declare a variable of type "X function() ref"
Apr 11, 2011
timon.gehr@gmx.ch
Jun 07, 2011
yebblies
April 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5828

           Summary: Cannot declare a variable of type "X function() ref"
                    without auto
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: timon.gehr@gmx.ch


--- Comment #0 from timon.gehr@gmx.ch 2011-04-10 01:16:36 PDT ---
DMD rejects explicit declarations of variables of type "X function() ref", while internally this is a valid type:

int a;
ref int g(){return a;}

int main(){
    //ref int function() f=&g; //error
    //int function ref() f=&g; //error
    auto f=&g; //ok
    writeln(typeof(f).stringof); //"int function() ref"
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 11, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5828



--- Comment #1 from timon.gehr@gmx.ch 2011-04-11 05:19:38 PDT ---
There is a typo:
I meant to write

//int function() ref f=&g; //error

Instead of

//int function ref() f=&g; //error

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5828


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |DUPLICATE


--- Comment #2 from yebblies <yebblies@gmail.com> 2011-06-06 21:26:33 PDT ---
*** This issue has been marked as a duplicate of issue 2753 ***

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