Thread overview
[Issue 6903] New: Auto Return Doesn't Work With Nested Functions
Nov 07, 2011
David Simcha
Nov 07, 2011
Kenji Hara
November 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6903

           Summary: Auto Return Doesn't Work With Nested Functions
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: dsimcha@yahoo.com


--- Comment #0 from David Simcha <dsimcha@yahoo.com> 2011-11-07 08:38:26 PST ---
This may technically be an enhancement request, but it seems like a massive, glaring inconsistency for no good reason, so I consider it a bug.

void main() {
    auto foo() {
        return 3;
    }
}

test.d(2): function declaration without return type. (Note that constructors
are always named 'this')
test.d(2): no identifier for declarator foo()

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


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from bearophile_hugs@eml.cc 2011-11-07 09:34:33 PST ---
See bug 4401

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


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

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


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-07 09:54:21 PST ---
This is parser problem, and there is no reason to reject it from dmd internally (e.g. The return type of function literal is almost inferred).

*** This issue has been marked as a duplicate of issue 4401 ***

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