www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5959] New: Return by reference with nested function should be allowed

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: k.hara.pg gmail.com



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: -------
May 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5959


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



23:52:40 PDT ---
https://github.com/D-Programming-Language/dmd/commit/508ef9681683bad67e4b8516945b974f3716a56b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 04 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5959


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |resume755 mail.ru



*** Issue 2509 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 06 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5959


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



Already fixed, but not marked.

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