Thread overview
[Issue 4401] New: auto functions cannot be inner functions
Jun 28, 2010
Philippe Sigaud
Jun 29, 2010
Ellery Newcomer
Jun 30, 2010
Leopold Walkling
Jul 01, 2010
Ellery Newcomer
Jul 30, 2011
klickverbot
Jul 30, 2011
klickverbot
Nov 07, 2011
Kenji Hara
Nov 07, 2011
Kenji Hara
Nov 08, 2011
Walter Bright
June 28, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4401

           Summary: auto functions cannot be inner functions
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: philippe.sigaud@gmail.com


--- Comment #0 from Philippe Sigaud <philippe.sigaud@gmail.com> 2010-06-28 16:07:11 CEST ---
It seems auto function cannot be inner functions:

void foo()
{
    string bar(string s) { return s;} // works
    auto   baz(string s) { return s;} // error!
}

Errors:

main.d|13|found 's' when expecting ')'|
main.d|13|semicolon expected, not ')'|
main.d|13|found ')' instead of statement|

Reading the docs, nothing tells me auto functions cannot be used as inner function. So either it's a bug or you should update the docs.

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



--- Comment #1 from Ellery Newcomer <ellery-newcomer@utulsa.edu> 2010-06-28 21:32:58 PDT ---
Created an attachment (id=686)
allow parsing inner auto functions

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


Leopold Walkling <leopold_walkling@web.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |leopold_walkling@web.de


--- Comment #2 from Leopold Walkling <leopold_walkling@web.de> 2010-06-30 12:58:50 PDT ---
While skimming parser.c I noticed that the auto keyword is treated like a storage specifier, so this one is allowed:

auto void bar() { }

The spec says nothing about this case, but it seems nonsensical.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4401



--- Comment #3 from Ellery Newcomer <ellery-newcomer@utulsa.edu> 2010-07-01 09:10:51 PDT ---
seems this is a duplicate of issue 3654

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4401


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |baryluk@smp.if.uj.edu.pl


--- Comment #4 from bearophile_hugs@eml.cc 2010-07-01 09:34:46 PDT ---
*** Issue 3654 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: -------
July 30, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4401


klickverbot <code@klickverbot.at> changed:

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


--- Comment #5 from klickverbot <code@klickverbot.at> 2011-07-30 15:35:55 PDT ---
*** Issue 5045 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: -------
July 30, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4401



--- Comment #6 from klickverbot <code@klickverbot.at> 2011-07-30 15:37:38 PDT ---
For newer DMD versions, the error messages seems to have moved a level higher: »function declaration without return type. (Note that constructors are always named 'this')«

-- 
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=4401


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha@yahoo.com


--- Comment #7 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-07 09:54:21 PST ---
*** Issue 6903 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: -------
November 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4401


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #8 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-07 10:35:05 PST ---
D2 Patch: https://github.com/D-Programming-Language/dmd/pull/500

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


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #9 from Walter Bright <bugzilla@digitalmars.com> 2011-11-07 21:43:53 PST ---
https://github.com/D-Programming-Language/dmd/commit/9f6e32ec88f4137b5030785813cd7b20c94831d5

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