[Issue 5959] New: Return by reference with nested function should be	allowed
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sun May  8 12:10:05 PDT 2011
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=5959
           Summary: Return by reference with nested function should be
                    allowed
           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: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-05-08 12:06:04 PDT ---
Define nested ref function is not allowed with current dmd, but should be.
----
int n;
void main()
{
    ref int f(){ return n; }            // NG
//  nothrow ref int f(){ return n; }    // OK
//  auto ref int f(){ return n; }       // OK
    f() = 1;
    assert(n == 1);
----
See parse.c, calling route parseDeclDefs -> parseDeclaration changed with dmd
2.020(Fixing issue 2345), but did not changed parseStatement ->
parseDeclaration from git brame.
It seems to me that this is a parser problem.
-- 
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